I have just spent most of today (sunday) working on my assembly programming assignment..its finished by the way.....lol, I just have to write another version of the code that runs faster. It was just a matrix multiplication code in C that we had to rewrite in MIPS 64 Assembly. The hardest part for me was knowing how to calculate the index in a 2-d array in assembly. I finally figured it out, so check this out:
consider a simple 2-d array a[i][j]. To get the element at this location, we simply use the formula:
(i * max_index_of_i +j)<<3.
We need to shift by 3, because in assembly, we are just stepping through an array, and each element occupies 8 bits.
So this principle is shown in MIPS64 assembly code to reference p[i][k] in a 3x3 array.
daddi $t7, $r0, 3 ; $t7=3
dmul $t6, $t0, $t7 ; $t6=i*3
dadd $t6 , $t6, $t2 ; i*3 +k
dsll $t4, $t6, 3 ; $t4=(i*3+k)<<3 multiply by 3
daddi $t8, $r0, p ; get base address of p
dadd $t8, $t8,$t4 ; $t8 has the address of p[i][k]
lw $t9, 0($t8) ; $t9 has the value of p[i][k]
Now I am getting back to debugging. See you later!
Sunday, October 28, 2007
Wednesday, October 24, 2007
We finally finished the first assignment of the compiler construction project, which was to make the reference compiler recognize records. We were able to compile the test file, record.ast, and it generated the right c-code. Today, we simply ported the code from the old compiler to the new one. The new one had some new assert statements, to check if the right subtype was being used, and all, but it didn't take so long.
We now began the testing phase. We have this Java applet called diagnostix which is able to evaluate the quality of our test suite, and it showed us that our test cases detected 3/5 bugs the compiler should guard against...not bad for our first day of testing, and we are way ahead of schedule.
An interesting case we had was checking that a record name could not be used as a variable name, and also checking that it is illegal in our compiler to check for equality of two records.
Later, thats all for today.
We now began the testing phase. We have this Java applet called diagnostix which is able to evaluate the quality of our test suite, and it showed us that our test cases detected 3/5 bugs the compiler should guard against...not bad for our first day of testing, and we are way ahead of schedule.
An interesting case we had was checking that a record name could not be used as a variable name, and also checking that it is illegal in our compiler to check for equality of two records.
Later, thats all for today.
Thursday, October 18, 2007
Compiler construction
I am currently working on the compiler construction course with my greek partner, and its one of the baddest courses in my msc program. We basically have a reference compiler written in C, called asterix, and we are meant to make the compiler recognize record structures. The code generation part has to generate c-structs for the records. For the second assignment, we are meant to change the entire back end code generator from producing C code to assembly.
So far so good, things are alright, we were able to compile a simple record program, and our compiler was able to generate C structs, which was a relief.
Now we need to implement the dot (.) operator so that it is possible to do stuff like this:
record foo is
begin
a:int;
end
Now, our extended compiler should be able to handle statements like
f:foo /*record declaration */
f.a:=2.
But unfortunately, we still get a segmentation fault, which we might tackle tomorrow.
Well more news later, and Im still thesis hunting.
So far so good, things are alright, we were able to compile a simple record program, and our compiler was able to generate C structs, which was a relief.
Now we need to implement the dot (.) operator so that it is possible to do stuff like this:
record foo is
begin
a:int;
end
Now, our extended compiler should be able to handle statements like
f:foo /*record declaration */
f.a:=2.
But unfortunately, we still get a segmentation fault, which we might tackle tomorrow.
Well more news later, and Im still thesis hunting.
Wednesday, August 15, 2007
Finally, I was able to install, MySQL 5.0. I had problems with it before. I am not sure about why it worked now, but maybe its because I ran spybot on my system and found out that there was a script on my system that had messud up my security centre updates....
Well now I have entered into the cool part of ruby, which is the rails framework. The framework uses the WEBrick server, and all I had to do was just type
ruby script/server, at the command prompt, and that was enough to start the server. This dosent need any fancy XML configuration files like I was doing with Apache Tomcat in the days of JSP.
Then I simply opened my browser window and entered this url http://localhost:3000/
and viola:

Rails uses a Model View controller paradigm, and one has to create a controller, and give the controller a couple of actions.....
The controller is a .rb file which has a class inheriting from class ApplicationController.
Well I gotta go back to study, I will write some more later.
Went to a bookstore and saw this cute book on python.......who knows,that might be my next project......
Well now I have entered into the cool part of ruby, which is the rails framework. The framework uses the WEBrick server, and all I had to do was just type
ruby script/server, at the command prompt, and that was enough to start the server. This dosent need any fancy XML configuration files like I was doing with Apache Tomcat in the days of JSP.
Then I simply opened my browser window and entered this url http://localhost:3000/
and viola:
Rails uses a Model View controller paradigm, and one has to create a controller, and give the controller a couple of actions.....
The controller is a .rb file which has a class inheriting from class ApplicationController.
Well I gotta go back to study, I will write some more later.
Went to a bookstore and saw this cute book on python.......who knows,that might be my next project......
Tuesday, August 14, 2007
Thesis hunt
I havent blogged for like a month now........its because I didnt think I had done anything freaky enough to blog about.
Right now I am shopping for a master thesis project in a company. Ive gotten a couple of them, and Im still chilling and watching, till I make my final decision.
One interesting thesis project is about a repository for documentation. Different stakeholders in the system (i.e mechanical engineer, software architect), should be able to access the system and view documentation, relevant to their area of interest.
The repository is basically for embedded systems, and the main snag is that embedded systems are made up of hardware and software, and mechatronical parts, and there isnt any sort of way of defining relations between these artifacts.
UML cant be used, cus its just meant for modelling OO software systems, so I need to
1 Find relations that can be used in this context.
2.See how all this can be applied in a reverse engineering framework.
The project also involves some traceability, in the sense that a user should be able to trace a certain requirement from the highest level of abstraction, throughout the system, into hardware and software parts.
Whew.......thats just one of them........I will be back later.
Meanwhile, Im still doing ruby, but taking it slowly.
Right now I am shopping for a master thesis project in a company. Ive gotten a couple of them, and Im still chilling and watching, till I make my final decision.
One interesting thesis project is about a repository for documentation. Different stakeholders in the system (i.e mechanical engineer, software architect), should be able to access the system and view documentation, relevant to their area of interest.
The repository is basically for embedded systems, and the main snag is that embedded systems are made up of hardware and software, and mechatronical parts, and there isnt any sort of way of defining relations between these artifacts.
UML cant be used, cus its just meant for modelling OO software systems, so I need to
1 Find relations that can be used in this context.
2.See how all this can be applied in a reverse engineering framework.
The project also involves some traceability, in the sense that a user should be able to trace a certain requirement from the highest level of abstraction, throughout the system, into hardware and software parts.
Whew.......thats just one of them........I will be back later.
Meanwhile, Im still doing ruby, but taking it slowly.
Thursday, June 7, 2007
LaTex
I have to write this report for a course called computer architecture: special topics.
We were required to read a few scientific papers relating to any area relating to computer architecture, and then make some presentations and write a report.
I was all right with it, until the prof announced he wanted the report to be in a format called LaTex.
First I was like WTF? Then I got a book from the library and checked it out. Seems its a markup language for formatting scientific journals and reports.
I was like "why cant these dudes just use word and get it over with?" So in addition to research and all, I had to learn a new markup language.
Well I decided to stop complaining and installed Miktek, and TeXniCentre. And I jumped in, as I love to do.After doing a few trial runs, and viewing the output in PDF, I could see why scientists and all like using this . The output is of really high quality and really really tight. So if you feel like, just try it and play with it. If you could learn HTML, then I am sure you can handle LaTex.
Ciao!
We were required to read a few scientific papers relating to any area relating to computer architecture, and then make some presentations and write a report.
I was all right with it, until the prof announced he wanted the report to be in a format called LaTex.
First I was like WTF? Then I got a book from the library and checked it out. Seems its a markup language for formatting scientific journals and reports.
I was like "why cant these dudes just use word and get it over with?" So in addition to research and all, I had to learn a new markup language.
Well I decided to stop complaining and installed Miktek, and TeXniCentre. And I jumped in, as I love to do.After doing a few trial runs, and viewing the output in PDF, I could see why scientists and all like using this . The output is of really high quality and really really tight. So if you feel like, just try it and play with it. If you could learn HTML, then I am sure you can handle LaTex.
Ciao!
Thursday, May 31, 2007
pimpin my windows
I just finished pimping my windows xp. I basically just replaced my utheme.dll file with a special patch, enabling my xp to support themes.....especially vista.........lol
So men My windows is the bomb!!!
So men My windows is the bomb!!!
Monday, May 28, 2007
Progress so far
Yesterday I was able to install ruby and rails with the one click installer.
It drove me nuts a bit cus the command line window i used didnt reflect the path changes ruby had made.
I wrote my first web application......I'm a bit impressed.
The Rails framework uses the MVC architecture. It creates a view, and controller.
Pretty cool.
Only downside was when I tried to install mysql and I kept getting
error 2003, cannot connect to mysql server onlocalhost.
This is 2007, so it should be error 2007......du--h.
Oh and I think I over used the DAS-2 supercomputer on my last assignment, so my pvm code began messing up. But im finished anyways.
Gotta do the second assignment, matrix operations in HPF......in a parallel way.
Ciao all!
It drove me nuts a bit cus the command line window i used didnt reflect the path changes ruby had made.
I wrote my first web application......I'm a bit impressed.
The Rails framework uses the MVC architecture. It creates a view, and controller.
Pretty cool.
Only downside was when I tried to install mysql and I kept getting
error 2003, cannot connect to mysql server onlocalhost.
This is 2007, so it should be error 2007......du--h.
Oh and I think I over used the DAS-2 supercomputer on my last assignment, so my pvm code began messing up. But im finished anyways.
Gotta do the second assignment, matrix operations in HPF......in a parallel way.
Ciao all!
Wednesday, May 23, 2007
My dive into Ruby
Right now I am exhausted. I just got back from a meeting with my presentation partner about Mpeg-4 motion detection algorithms and their hardware architectures.
I needed something to learn that was interesting and not part of "normal " schoolwork.
Well I have been thinking of learning either perl, python , or ruby.
I have chosen the latter, so Im going to start studying it from today, and see what its got to offer.
I was just tempted by this lovely book called "the ruby way" by Hal Fulton.
I will have to sign out now............Lets see what ruby and the gym have got to offer me.
I needed something to learn that was interesting and not part of "normal " schoolwork.
Well I have been thinking of learning either perl, python , or ruby.
I have chosen the latter, so Im going to start studying it from today, and see what its got to offer.
I was just tempted by this lovely book called "the ruby way" by Hal Fulton.
I will have to sign out now............Lets see what ruby and the gym have got to offer me.
Tuesday, May 22, 2007
Assignment feedback
I just got feedback from a C++ assignment that I did, and I sorta made a foolish mistake. This was the feedback I got from the student assistant:
Bank::Bank()
{
account_list = AccountList();
// What is happening here is that first the default constructor is called, because
// no explicit call is made beforehand. Then you OVERWRITE the already created
// AccountList with a temporary new one (which happens to be idential).
}
Yeah I know.......I had another class called AccountList that initialized itself automatically when i called the Bank() constructor, simply by virtue of the fact that I had an AccountList object in my private variable section.
Now doing it the way I did would me result in creating the AccountList object twice and then rewiting the original value.....with the same results. Well, we get the same answer, but its not good to screw around creating redundant objects.
And the second student assistant, advised me to do it the way I did it, oh well, we learn everyday.
Bank::Bank()
{
account_list = AccountList();
// What is happening here is that first the default constructor is called, because
// no explicit call is made beforehand. Then you OVERWRITE the already created
// AccountList with a temporary new one (which happens to be idential).
}
Yeah I know.......I had another class called AccountList that initialized itself automatically when i called the Bank() constructor, simply by virtue of the fact that I had an AccountList object in my private variable section.
Now doing it the way I did would me result in creating the AccountList object twice and then rewiting the original value.....with the same results. Well, we get the same answer, but its not good to screw around creating redundant objects.
And the second student assistant, advised me to do it the way I did it, oh well, we learn everyday.
Architectural Mismatch
This is a paper review/reading log that I did for one of my specialization courses, SWARM(Software architecture recovery and modelling ).
The paper is about architectural erosion, and Its authored by Dave garlan,Robert Allen, and John Ockerbloom all of whom are from the Computer Science Dept of Carnegie mellon university, a school I respect.
The paper is just about how the assumptions we make about software components, affect the way they connect/fit to each other when we are trying to use them in building a large software system.
So below are the contents of my reading log, enjoy.......oh strange user.
Note: In every paper we read, we are meant to look into the feasibility of applying the technique to a "real-life" case study, in this case the migration of a monolithic blob of software for a television , to a linux platform....
Reading log for "Architectural mismatch" paper
----------------------------------------------
The authors main points:
-----------------------
The author points out that in software engineering, most people expect that in order to build a software system,
we should do so from building blocks. But the error in that is that most components are built based on assumptions about
the environement in which they will operate. These cause issues in the way the components fit together, and is known as
architectural mismatch.
The author goes on to highlight the main causes of architectural mismatch as follows:
1.Assumptions about the nature of the components
2.Assumptions about the nature of the connectors
3.Assumptions about the global architectural structure
4.Assumptions about the construction process.
The author suggests that careful consideration should go into building components that are intended to be used for
larger systems, but in my opinion, that is difficult to predict.
The author states four necessary aspects neccessary for a long-term solution
1. Make architectural assumptions explicit
2. Construct large pieces of software using orthogonal sub-components
3. Provide techniques for bridling mismatches
4. Developing sources of design guidance
Points I agree with
-------------------
1. I agree with the authors statement of causes of architectural erosion
2. I agree that ideally, when building components, they should be built with a view to being integrated
into a larger system
3 I also agree with the authors aspects for long term solutions to architectural mismatch.
Points I disagree with
----------------------
It isnt possible to predict which component would be used as a building block for a larger system.
I would imagine that building them the way the author suggests might lead to making the component very generic,
and as a result, eroding some of the functionality of the component.
Application to TV case
----------------------
Since the paper deals with systems built from components, and the tv case is simply one of migration to a new system and
doing some stripping down of the monolithic blob to the bare essentials, I have my doubts as to the
applicability of this to our case. The only thing i can think of is that maybe when we might decide to add extra functionality to the
ported system (in terms of new functional requirements), that we take the warning (about architectural erosion) into consideration.
The paper is about architectural erosion, and Its authored by Dave garlan,Robert Allen, and John Ockerbloom all of whom are from the Computer Science Dept of Carnegie mellon university, a school I respect.
The paper is just about how the assumptions we make about software components, affect the way they connect/fit to each other when we are trying to use them in building a large software system.
So below are the contents of my reading log, enjoy.......oh strange user.
Note: In every paper we read, we are meant to look into the feasibility of applying the technique to a "real-life" case study, in this case the migration of a monolithic blob of software for a television , to a linux platform....
Reading log for "Architectural mismatch" paper
----------------------------------------------
The authors main points:
-----------------------
The author points out that in software engineering, most people expect that in order to build a software system,
we should do so from building blocks. But the error in that is that most components are built based on assumptions about
the environement in which they will operate. These cause issues in the way the components fit together, and is known as
architectural mismatch.
The author goes on to highlight the main causes of architectural mismatch as follows:
1.Assumptions about the nature of the components
2.Assumptions about the nature of the connectors
3.Assumptions about the global architectural structure
4.Assumptions about the construction process.
The author suggests that careful consideration should go into building components that are intended to be used for
larger systems, but in my opinion, that is difficult to predict.
The author states four necessary aspects neccessary for a long-term solution
1. Make architectural assumptions explicit
2. Construct large pieces of software using orthogonal sub-components
3. Provide techniques for bridling mismatches
4. Developing sources of design guidance
Points I agree with
-------------------
1. I agree with the authors statement of causes of architectural erosion
2. I agree that ideally, when building components, they should be built with a view to being integrated
into a larger system
3 I also agree with the authors aspects for long term solutions to architectural mismatch.
Points I disagree with
----------------------
It isnt possible to predict which component would be used as a building block for a larger system.
I would imagine that building them the way the author suggests might lead to making the component very generic,
and as a result, eroding some of the functionality of the component.
Application to TV case
----------------------
Since the paper deals with systems built from components, and the tv case is simply one of migration to a new system and
doing some stripping down of the monolithic blob to the bare essentials, I have my doubts as to the
applicability of this to our case. The only thing i can think of is that maybe when we might decide to add extra functionality to the
ported system (in terms of new functional requirements), that we take the warning (about architectural erosion) into consideration.
Monday, May 21, 2007
Introduction
My dreams can be summarized as follows:
1. Give something back to the world of computing
2. Become awesomely stinkingly rich by doing number 1
This blog is born out of goal number 1. Here I aim to chronicle my thoughts about computing
programming and related stuff in general. I will blog about technical challenges in school, my personal opinions about new tecnology and all..........and my ideas in general.
I will also offer my own humble opinions about any IT related articles and journals I read during the week.
What do I do? Im into programming, and computing in general, both theoretical and practical.. and yeah....you guessed it, im a geek. I code in the following languages:
Java
C/C++
Assembly
pvm (Parallel programming)
and weird stuff that people dont like talking about. I'm currently pursuing my masters degree in computer engineering at the Delft University of Technology, the Netherlands.
I also muck around with linux a bit, even though when Im lazy (which is most times) I just use cygwin to carry out unix related projects.
Well enough about me, Lets get this party started.
1. Give something back to the world of computing
2. Become awesomely stinkingly rich by doing number 1
This blog is born out of goal number 1. Here I aim to chronicle my thoughts about computing
programming and related stuff in general. I will blog about technical challenges in school, my personal opinions about new tecnology and all..........and my ideas in general.
I will also offer my own humble opinions about any IT related articles and journals I read during the week.
What do I do? Im into programming, and computing in general, both theoretical and practical.. and yeah....you guessed it, im a geek. I code in the following languages:
Java
C/C++
Assembly
pvm (Parallel programming)
and weird stuff that people dont like talking about. I'm currently pursuing my masters degree in computer engineering at the Delft University of Technology, the Netherlands.
I also muck around with linux a bit, even though when Im lazy (which is most times) I just use cygwin to carry out unix related projects.
Well enough about me, Lets get this party started.
Subscribe to:
Comments (Atom)