1 / 23

Hardware/Software Codesign with SystemC

Hardware/Software Codesign with SystemC. HM-ES-th1 Les 9. SystemC  VHDL. Commerciële tools: http://www.systemcrafter.com/ http://www.forteds.com/products/cynthesizer.asp http://www.mentor.com/esl/catapult/overview http://www.cadence.com/products/sd/silicon_compiler/pages/default.aspx

najila
Télécharger la présentation

Hardware/Software Codesign with SystemC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hardware/Software Codesign with SystemC HM-ES-th1 Les 9

  2. SystemC  VHDL • Commerciële tools: • http://www.systemcrafter.com/ • http://www.forteds.com/products/cynthesizer.asp • http://www.mentor.com/esl/catapult/overview • http://www.cadence.com/products/sd/silicon_compiler/pages/default.aspx • Wetenschappelijke tools: • Fossy: http://system-synthesis.org/

  3. GCD with Fossy • Het SystemC cycle accurate model van de GCD component kan door Fossy worden omgezet naar VHDL • Er moet een SC_CTHREAD i.p.v. een SC_THREAD gebruikt worden. • Er moet een reset signaal worden toegevoegd d.m.v. reset_signal_is

  4. Input voorFossy #include<systemc> usingnamespacesc_core; usingnamespacesc_dt; usingnamespacestd; template <typenameT> SC_MODULE(gcd) { sc_in_clkclk; sc_in<bool> reset; sc_in<bool> go_i; sc_in<T> x_i, y_i; sc_out<bool> done_o; sc_out<T> r_o; SC_CTOR(gcd) { SC_CTHREAD(run, clk.pos()); reset_signal_is(reset, true); } SC_CTHREAD reset_signal_is

  5. Input voorFossy (vervolg) private: void run() { // ... } }; intsc_main(intargc, char *argv[]) { gcd<unsignedint> gcd("gcd"); return 0; }

  6. gcd::run() voidrun() { wait(); while(1) { do { wait(); } while (!go_i.read()); T x = x_i.read(); T y = y_i.read(); wait(); while (go_i.read() && x != y) { if (x > y) { x -= y; } else { y -= x; } wait(); } if(go_i.read()) { r_o.write(x); done_o.write(true); } De door Fossygegenereerde VHDL code staat op BB (voor de liefhebber) do{ wait(); } while (go_i.read()); done_o.write(false); } }

  7. GCD op NIOS II • We kunnen het in les7 in SystemC gespecificeerde GCD algoritmeook in software implementeren. • Bijvoorbeeldalseen C functie op een NIOS II softcore.

  8. Performance Counter • We kunnen de executietijd van dezeapplicatiemeten met behulp van een Performance Counter http://www.altera.com/literature/ug/ug_embedded_ip.pdf(chapter 34) • De Performance Counter moet in SOPC Builder wordentoegevoegd.

  9. NIOS II IDE • Om (later) C2H te kunnen gebruiken moeten we gebruik maken van de NIOS II IDE in plaats van de NIOS II Software Build Tools voor Eclipse. • Deze tool kun je opstarten via het start menu en is ook op Eclipse gebaseerd.

  10. GCD op NIOS II Section number. Each performance counter can measure multiple sections of code. The max number of sections is defined in SOPC Builder. Performance counter base address (defined in system.h)

  11. GCD op NIOS II Reset and initialize Global start Global stop Report Number of sections measured Name for each section

  12. GCD op NIOS II • Uitvoer: 1790 logic cells

  13. C2H • Met behulp van de C2H tool kan een C functie automatisch in hardware worden geïmplementeerd! • C2H genereert een hardware accelerator inclusief de interface hardware met de NIOS II en het geheugen. • C2H genereert de software interface. Bij de function call worden: • De parameters naar registers van de hardware accelerator geschreven. • Het START bit in de hardware accelerator wordt geset. • Het STATUS bit van de hardware accelerator wordt gelezen totdat deze aangeeft dat de accelerator klaar is. • Tot slot wordt het resultaat (de return waarde) uit een register van de hardware accelerator gelezen.

  14. C2H

  15. C2H 1: Select a function

  16. C2H 2: Select options

  17. C2H 3: Build and view report

  18. C2H 3: Build and view report

  19. C2H 4: Hardware downloaden We need to use the time_limited version because we do not have a commercial license for C2H

  20. C2H 5: Software laden + runnen • Uitvoer: 80x sneller 2402 logic cells 1.34x more logic

  21. C2H 6: Software Optimaliseren 18x sneller 1.34x more logic

  22. C2H • Het is ook mogelijk dat de accelerator zelf het geheugen benaderd (DMA = Direct Memory Access).

  23. C2H op practicum • Ideal Acceleration Candidates:Sections of C code that consume the most CPU time with the least amount of code are excellent candidates for acceleration. These tend to have the following characteristics: • They contain a relatively small and simple loop or set of nested loops. • They iterate over a set of data, performing one or more operations on the data per iteration, and then store the result. http://www.altera.com/literature/ug/ug_nios2_c2h_compiler.pdfZie hoofdstuk 2: GettingStarted Tutorial

More Related