log book
my supposedly updated daily log book!
<
next |
previous >
- 26/02/2010
-
Since the last update there has been quite a bit of progress.
The Simulator has been re-written, it is now a lot quicker (around 500x?). The way it now works is for the driver thread to call functions which are the cycles, this means there is nothing which needs to be passed as the variables are all global. At the end of each cycle the next_pc is set.
I have compared the output of a single threaded piece of code with VEX and it now matches, there were some issues with RSUB, calls and returns, and with using registers which were being set in the same cycle.
The memory system is also now in place, it stalls threads and allows the user to change the number of banks. The stack system is in place and allows the user to change the size given to each thread. However, it does not check that there are no writes outside the allocated stack areas.
V wants me to find some other pthread_code and we will also be implementing more pthread instructions (mutex and pthread_join).
The machine code still does not match the Simulator for Custom Instructions.
- 18/02/2010
-
I have edited the mandelbrot code to allow for threads, it is compiled and currently running with the simulator. The original 256 x 256 image was taking a long time to run, I have changed the size to 16 x 16, it should take around 3 hours to run (with 3 threads).
At the moment the Simulator is using a perfect memory model, I need to add in a method of checking loads and stores and serving the memory accesses from the main thread. This will be done using a circular buffer and a stall array, if the thread is stalled and waiting for memory it should output a stalled message.
The Simulator is also not correct with the stack, each thread writes to the same area of the stack, this needs to be altered to allow a certain amount of space for each thread (4K?) and then the SP set at initialisation.
- 17/02/2010
-
After having a few issues with the Simulator and pthreads it now works with using the pthread_create instruction.
To get this to work I have had to use a macro to replace the pthread_create instruction with a normal call, this is so that VEX outputs the assembly to move all the required registers to the function. The Assembler then generates the Simulator C code and replaces the call with a pthread_create by using a script at the start of the process which looks for pthread_create and saves the line number.
Current processes:
- pthread.pl (read the C code and look for pthread_create and save line number)
- run VEX (get the .s files)
- firstpass (read the .s file and the file outputted by the pthread.pl file, it adds extra instructions that the call is really a pthread_create)
- midpass (if needed)
- secondpass (reads the temp.s file and if a call it will look for the new extra instruction it will replace this with a pthread_create in the Simulator)
At the moment the Machine Code output does not represent the Simulator as it does not show the custom instructions (pthread_create).
Need to alter the mandelbrot code to work threaded and run it through the simulator.
Getting a computer setup in Sijung's lab with MatLAB so that I can create the outputs needed, this code will also be good to work with the new Simulator.
- 11/02/2010
-
Also, V sent a newer version of the ISA.
This is drastically different to the old one, I think I am going to hold off from it at the moment because the instructions aren't outputted by VEX anyway?
- 11/02/2010
-
This week I have been getting the Simulators output to match the old VEX output. At the moment it is matching bar the sources, they are in a different order, all the data is correct though.
I had a some issues getting the data correct, I had to re-implement the Simulator output until the last thing. This was due to the syllables being edited right up to the end of the Second Pass.
V mentioned getting this ready and getting some data ready for a paper for the 18th of Feb. That is 1 week today, it might be a bit of a stretch. Maybe it is doable, possibly something easy like the mandelbrott code?