1 / 11

Hardware/Software Codesign with SystemC

Hardware/Software Codesign with SystemC. HM-ES-th1 Les 4. SystemC Hiërarchie. Een module kan (sub)modules bevatten. i n port. module. channel. submodule. submodule. out port. Verbindingen tussen modules. Verbindingen tussen hiërarchische niveaus:

chipo
Download Presentation

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 4

  2. SystemC Hiërarchie • Een module kan (sub)modules bevatten in port module channel submodule submodule out port

  3. Verbindingen tussen modules • Verbindingen tussen hiërarchische niveaus: • Input van module (rechtstreeks) verbonden met input van submodule. • Outputvan submodule(rechtstreeks) verbonden met outputvan module. • Verbindingen binnen een hierarchische niveau: • Output van een module (via een channel) verbonden met de input van een andere module (op hetzelfde niveau).

  4. 2 bit full adder • Schema (opgebouwd uit twee 1 bit full adders). Cin A0 B0 A1 B1 Adder2Bits adder0 adder1 Cin Cin A A B B S S Cout Cout carry S1 Cout S0

  5. 2 bit full adder SC_MODULE(Adder2Bits) { sc_in<sc_logic> A0, B0, A1, B1, Cin; sc_out<sc_logic> S0, S1, Cout; SC_CTOR(Adder2Bits): adder0("adder0"), adder1("adder1") { adder0.A(A0); adder0.B(B0); adder0.Cin(Cin); adder0.S(S0); adder0.Cout(carry); adder1.Cin(carry); adder1.A(A1); adder1.B(B1); adder1.S(S1); adder1.Cout(Cout); } private: Adder adder0, adder1; sc_signal<sc_logic> carry; };

  6. 2 bit full adder (alternatief) SC_MODULE(Adder2Bits) { sc_in<sc_logic> A0, B0, A1, B1, Cin; sc_out<sc_logic> S0, S1, Cout; SC_CTOR(Adder2Bits) { SC_METHOD(add); sensitive<< A0 << B0 << A1 << B1 << Cin; } private: voidadd() { sc_uint<3> a = 0, b = 0, c = 0; a[1] = A1.read().to_bool(); a[0] = A0.read().to_bool(); b[1] = B1.read().to_bool(); b[0] = B0.read().to_bool(); c[0] = Cin.read().to_bool(); sc_uint<3> s = a + b + c; S0.write(sc_logic(s[0].to_bool())); S1.write(sc_logic(s[1].to_bool())); Cout.write(sc_logic(s[2].to_bool())); } };

  7. De 2 bit full adder opgebouwd met twee 1 bit full adders noemen we een structural model. • De 2 bit full adder waarvan het gedrag wordt beschreven zonder gebruik te maken van submodules noemen we een behavioral model.

  8. Modules • Modules are the basic building blocks for partitioning a design • A module is a structural entity, which can contain processes, ports, channels, member functions not registered as processes and instances of other modules • A module is the foundation of structural hierarchy • Modules allow designers to hide internal data representation and algorithms from othermodules • Designers are forced to use public interfaces to other modules, thus making the entire system easier to change and maintain  reusability = lower design time

  9. Processes • Processes are small pieces of code that run concurrently withotherprocesses. • Functionality is described in processes. • Processes must be contained withina module. • They are registered as processes with the SystemC kernel, using a process declaration in the module constructor. • Processes accept no arguments and produce no output

  10. SystemC in UML

  11. Fixed point getallen • Eenfixed pointgetalheefteenbepaaldaantal bits voor de decimale punt en eenbepaaldaantal bits na de decimale punt. • Fixed point getallenkunnen in eenintegerwordenopgeslagen. De programmeurmoetdanwelzelfonthoudenwaar de decimale punt staat. • Rekenen met fixed point getallen: • Optellen en aftrekken nietsbijzonders. • Vermenigvuldigen resultaatnaarrechtsschuivenzodatdecimale punt weergoedstaat. • Delen resultaatnaar links schuivenzodatdecimale punt weergoedstaat.

More Related