Presentation is loading. Please wait.

Presentation is loading. Please wait.

Technische universiteit eindhoven Department of Electrical Engineering Electronic Systems Optimizing the mMIPS Sander Stuijk.

Similar presentations


Presentation on theme: "Technische universiteit eindhoven Department of Electrical Engineering Electronic Systems Optimizing the mMIPS Sander Stuijk."— Presentation transcript:

1 technische universiteit eindhoven Department of Electrical Engineering Electronic Systems Optimizing the mMIPS Sander Stuijk

2 Electronic Systems 2 Outline  Design flow  Understanding the assembler  Frequently asked questions  How do I recompile the compiler?  How can I abort a simulation?  How can I debug the mMIPS?  Where do I find the maximal frequency of my mMIPS?  Assignment

3 Electronic Systems 3 Toolflow LCC C Compiler Borland C++ Compiler LCC C Compiler Xilinx ISE Synopsys FPGA Compiler II Synopsys SystemC compiler Application (C source) mMIPS (C++ sources that use SystemC libraries) test implementation sw hw

4 Electronic Systems 4 Outline  Design flow  Understanding the assembler  Frequently asked questions  How do I recompile the compiler?  How can I abort a simulation?  How can I debug the mMIPS?  Where do I find the maximal frequency of my mMIPS?  Assignment

5 Electronic Systems 5 From C to assembler int main(void) { int a = 0; if (a == 0) return 0; else return 1; } 0: 00000000 nop 4: 3c1c0001 lui gp,0x1 8: 279c0000 addiu gp,gp,0 c: 3c1d0002 lui sp,0x2 10: 27bd8000 addiu sp,sp,-32768 14: 3c1e0002 lui s8,0x2 18: 27de8000 addiu s8,s8,-32768 1c: 0c000020 jal 0x80 20: 00000000 nop 24: 08000009 j 0x24 28: 00000000 nop... 40: 08000009 j 0x24 44: 00000000 nop... 60: 08000009 j 0x24 64: 00000000 nop... 80: 27bdfff8 addiu sp,sp,-8 Bootloader End of program Actual program

6 Electronic Systems 6 The boot loader... 0: 00000000 nop 4: 3c1c0000 lui gp,0x0 8: 279c24e2 addiu gp,gp,9442 c: 3c1d0000 lui sp,0x0 10: 27bd2800 addiu sp,sp,10240 14: 3c1e0000 lui s8,0x0 18: 27de2800 addiu s8,s8,10240 1c: 0c000020 jal 0x80 20: 00000000 nop 24: 08000009 j 0x24... 40: 08000009 j 0x24... 60: 08000009 j 0x24 The program is terminated by a repeated jump to address 0x24. We can stop the simulation by detecting this jump. Skip first instruction Global pointer Stack pointer Frame pointer Call main function Terminate program

7 Electronic Systems 7 Outline  Design flow  Understanding the assembler  Frequently asked questions  How do I recompile the compiler?  How can I abort a simulation?  How can I debug the mMIPS?  Where do I find the maximal frequency of my mMIPS?  Assignment

8 Electronic Systems 8 How do I recompile the LCC compiler? 1.export LCCDIR=/cygdrive/c/ImageProcessing/lcc/lccdir 2.cd $LCCDIR/.. 3.make clean 4.make

9 Electronic Systems 9 How can I abort a simulation?  Use + to abort a running simulation.  VCD trace stored till point at which simulation is stopped.

10 Electronic Systems 10 How can I debug the mMIPS?  Create a small test program to check the newly added functionality  Create a VCD trace via a simulation  Compare the VCD trace with the assembler  Start at the beginning of the program  Does it do what you expect?

11 Electronic Systems 11 Where do I find the maximal frequency of my mMIPS?  You can find the maximal frequency of your design in XilinX ISE  Estimate is given by FPGA II Compiler

12 Electronic Systems 12 Outline  Design flow  Understanding the assembler  Frequently asked questions  How do I recompile the compiler?  How can I abort a simulation?  How can I debug the mMIPS?  Where do I find the maximal frequency of my mMIPS?  Assignment

13 Electronic Systems 13 Assignment  Optimize the run-time of an image processing algorithm running on the mMIPS. Allowed  Add special instructions to the mMIPS;  Change design of the mMIPS (e.g. forwarding). Not-allowed  Modification of the image processing algorithm that are not needed to use special instructions (e.g. replace multiply with shifts).

14 Electronic Systems 14 Testing and implementing the design Test for functional correctness  Run the original mMIPS with the algorithm to produce a reference output.  Compare the results of your mMIPS to the reference output. Implement your design on the FPGA  You must complete the flow till the FPGA. The maximum clock frequency at which your mMIPS can be synthesized is part of the performance.

15 Electronic Systems 15 Submitting your results 1.Login to ftp://ftp.es.ele.tue.nl using your username/password 2.Put all.cpp and.h files in the directory ‘final’ 3.Put ‘mips_rom.bin’ and ‘mips_ram.bin’ in the directory ‘final’ Remarks  We need a working mMIPS to test your changes  Put all files directly in the directory ‘final’ do not use subdirectories  The input/output locations of your image must be the same as in our program  Your input image is automatically replaced with a new image by our tools

16 Electronic Systems 16 Important dates  Test program available on Sunday 5/3 at 12.00h  http://www.es.ele.tue.nl/education/Computation/oo2/ http://www.es.ele.tue.nl/education/Computation/oo2/  Submit results at Tuesday 7/3 before 12.00h  Make sure you submit before the deadline. It’s a hard deadline!  Presentations on Thursday 9/3 and Friday 10/3  You will be informed about the schedule

17 Electronic Systems 17 Support and Information  Dominic Gawlowski - FPGA  Valentin Gheorghita - LCC  Sander Stuijk - SystemC  Each Monday, Tuesday, Thursday and Friday between 14.00 and 16.00h.  Look also at http://www.es.ele.tue.nl/education/Computation/oo2/ for information, tips, etc.

18 Electronic Systems 18 Questions?


Download ppt "Technische universiteit eindhoven Department of Electrical Engineering Electronic Systems Optimizing the mMIPS Sander Stuijk."

Similar presentations


Ads by Google