SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Experiences with SystemC




Design Verification Using
       SystemC
         Greg Tierney

         Presented to
        DV Club, Boston
         March 5, 2007



           DV Club, Boston
Experiences with SystemC



                     About Avid
Invented digital video editing
Headquartered in Tewksbury
 – http://www.avid.com/company/
Products
 – Film/Video Editing and
   Finishing
 – Audio
 – Broadcast
 – Animation
 – Storage & Workgroups
 – Digital Asset and Production
   Management
Services
 – Support
 – Training
 – Consulting


                              DV Club, Boston
Experiences with SystemC



            Agenda
What is SystemC?
Why did Avid choose to use SystemC?
DV problems solved by SystemC.
Summary




              DV Club, Boston
Experiences with SystemC



         What is SystemC?
Provides hardware constructs and a simulation kernel
for C++
It is a class library
– And it is a language standard (IEEE 1666TM 2005)
It has utilities and constructs
– Data types, ports, channels, processes
Adopted by different disciplines
– Architectural Modeling (SoC, performance)
– DV (RTL simulation, HW/SW co-verification)
– Synthesis
It is open source (OSCI)
– http://www.systemc.org

                       DV Club, Boston
Experiences with SystemC



  Why Avid Chose SystemC
Enhanced existing C++ DV code
– Replaced an unreliable in-house framework
    • Signal encapsulation
    • Thread management
    • Random seed management
– Smooth transition from C++ to SystemC
Tool availability
– Single kernel multi-language simulator
Industry acceptance
Low cost
Came with built-in verification capabilities

                        DV Club, Boston
Experiences with SystemC



            Agenda
What is SystemC?
Why did Avid choose to use SystemC?
DV problems solved by SystemC.
Summary




              DV Club, Boston
Experiences with SystemC



Crossing Language Boundaries

Connect an entire HDL module to the
testbench.
– Wrap the module with a SystemC class
  (sc_foreign_module).
– Provide a string mapping for each port.
Connect a foreign signal anywhere in the
hierarchy.
– Bind a sc_signal (observe_foreign_signal).
– Provide a string of hierarchical path to wire or reg.

                     DV Club, Boston
Experiences with SystemC



                        Code Examples
class MyDUT : public sc_foreign_module {            SC_MODULE(MyVTB)
public:                                             {
  sc_in<sc_logic> reset;
                                                    public:
  sc_in<sc_logic> clock;
  sc_out<sc_lv<16> > AD;                              SC_CTOR(MyVTB) :
                                                         MyDUTInst(“MyDUTInst”, “MyDUT”),
  MyDUT(sc_module_nam nm, const char* hdl_name)          MyMonitorInst(“MyMonitorInst”,
   : sc_foreign_module(nm, hdl_name),                                  “MyVTB.MyDUTInst.FooInst”)
     reset(“reset”),
                                                      {
     clock(“clock”),
     AD(“AD”){}                                          MyDUTInst.reset(tb_reset);
};                                                       MyDUTInst.clock(tb_clock);
                                                         MyDUTInst.AD(tb_AD);
class MyMonitor : public sc_module {                  }
public:                                             private:
  MyMonitor(sc_module_name,                           MyDUT MyDUTInst;
            const string& path2DUT){                  MyMonitor MyMonitorInst;
    string path2sig = path2DUT + “.snoop”;
    snoopSig_.observe_foreign_signal(path2sig);       sc_signal<sc_logic>   tb_reset;
    SC_THREAD(threadT);                               sc_signal<sc_logic>   tb_clock;
    sensitive <<                                      sc_signal<sc_lv<16> > tb_AD;
       snoopSig_.value_changed_event();             };
  }
private:
  sc_signal<sc_logic> snoopSig_;
  void threadT();
};

                                           DV Club, Boston
Experiences with SystemC



      Issues with Binding
No clear standard for language boundary
resolution.
– Each vendor has its own implementation.
– Implementation we use doesn’t map arrays or
  records (yet).
Supporting foreign interface requires two
pass compilation.
– First pass creates object files.
– Second pass builds a symbol library used in
  design elaboration.

                    DV Club, Boston
Experiences with SystemC



SystemC Connections
   p
              start()                           p     start()




Call a public method                    Connect sc_port to a
via pointer to object                       sc_export


           outp      write()   read()     inp




                  Connect sc_port to a
                       channel


                        DV Club, Boston
Experiences with SystemC



                        Code Examples
struct start_stop_if : public sc_interface        SC_MODULE(MyTest){
{                                                 public:
  virtual void start()=0;                           sc_port<start_stop_if> bfm_port;
  virtual void stop()=0;                          };
};                                                SC_MODULE(vtb){
                                                  public:
class MyBFM :                                       SC_CTOR(vtb);
  public sc_module,                               private:
  public virtual start_stop_if                      sc_signal<sc_logic>   Clock;
{                                                   sc_signal<sc_logic>   Request;
public:                                             sc_signal<sc_lv<16> > AD;
  sc_in<sc_logic>   Clock;                          tlm::tlm_fifo<MyX>    MyXReceiveChan;
  sc_out<sc_logic> Request;                         MyTest                MyTestInst;
  sc_in<sc_lv<16> > AD;                             MyBFM                 MyBFMInst;
  tlm::tlm_put_port<MyX> MyXReceivePort;          };
  sc_export<start_stop_if> StartStopExport;
                                                  vtb:vtb(sc_module_name) :
  void start();                                     MyBFMInst(“MyBFMInst”), MyTestInst(“MyTestInst”)
  void stop();                                    {
                                                    MyBFMInst.Clock(Clock);
  SC_CTOR(MyBFM){                                   MyBFMInst.Request(Request);
     StartStopExport(*this);                        MyBFMInst.AD(AD);
  }                                                 MyBFMInst.MyXReceivePort(MyXReceiveChan);
};                                                  MyTestInst.bfm_port(MyBFMInst.StartStopExport);
                                                  }

                                         DV Club, Boston
Experiences with SystemC



   Issues with Connections
Construction and binding are separate steps.
– Ports must be public.
– Ports bound after modules and channels are constructed.
Binding uses “strict type checking”.
– Compilation will fail if type mismatch in the connection.
– Splitting a vector across multiple ports is complicated.
Binding errors detected at elaboration.
– Simulation should abort at runtime if a port is not bound.
– Need to assign attributes to port (e.g. # of connections).




                         DV Club, Boston
Experiences with SystemC



         Randomization
Separate library dedicated to verification
constructs (SCV).
Robust, rich feature set for
randomization.
– Simple constraints (ranges and lists).
– Complex constraint solver.
– Thread-safe seeding.
– Extendible to custom object types.

                  DV Club, Boston
Experiences with SystemC



    Randomization at Avid
SCV more than we needed.
– So, we use a subset of the features.
Provide a Tcl interface to apply constraints.
– Wrap scv_smart_ptr.
– Define string representations for simple
  constraints.
– Recompilation not required to change constraints.
– Reapply constraints over course of simulation.


                    DV Club, Boston
Experiences with SystemC



           Processes
Hardware is inherently parallel.
DV must be multi-threaded.
SystemC solves this with processes.
– Macros: SC_THREAD and SC_METHOD.
– Events, mutexes, semaphores.
– Dynamic processes (sc_spawn).



               DV Club, Boston
Experiences with SystemC



              Hierarchy

SystemC defines an object hierarchy.
– Relates objects (parent/child).
– Familiar to HDL design.
Avid DV defines a layer hierarchy.
– Relates connections.
– Familiar to communication stacks.
Issue: SystemC is not a methodology.

                  DV Club, Boston
Experiences with SystemC



Example Hierarchy
                                           VTOP

                                           VTEST

            Test




                              Translator              Reference Model       Scoreboard




                                           VTB
       TLM Agent
                              STIMGEN                  Analysis Agent      Analysis Agent




 Commander_BFM               TX_BFM               Snooper_BFM              RX_BFM


   Driver          Monitor     Driver               Monitor      Monitor      Monitor




                                           DUT




                                  DV Club, Boston
Experiences with SystemC



            Agenda
What is SystemC?
Why did Avid choose to use SystemC?
DV problems solved by SystemC.
Summary




              DV Club, Boston
Experiences with SystemC



           Additional Issues
Compile and link performance is disappointing.
– Overuse of C++ templates in library.
– Partially attributed to vendor implementation.
Libraries are huge.
Being a language standard has tool implications.
C++ learning curve.
– C++ code debug very different than HDL.
    • Segmentation faults, stack traces, code stepping
Think like a HW engineer, code like a SW engineer.



                          DV Club, Boston
Experiences with SystemC



      Avid’s Experience

Used reliably for nearly 3 years.
Runtime performance very satisfactory.
Provides opportunity to assist product
development beyond DV.
– Evaluate architectures and predict
  performance.
– Create programmer’s view models for
  emulation and HW/SW co-verification.
                DV Club, Boston

Contenu connexe

Tendances

Simple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaSimple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time Java
Universidad Carlos III de Madrid
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
DefconRussia
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Howard Lewis Ship
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering
종빈 오
 

Tendances (20)

Channel 2010
Channel 2010Channel 2010
Channel 2010
 
Simple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaSimple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time Java
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VM
 
Enhancing the region model of RTSJ
Enhancing the region model of RTSJEnhancing the region model of RTSJ
Enhancing the region model of RTSJ
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
The Java memory model made easy
The Java memory model made easyThe Java memory model made easy
The Java memory model made easy
 
C++ process new
C++ process newC++ process new
C++ process new
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Concurrency 2010
Concurrency 2010Concurrency 2010
Concurrency 2010
 
03 - Qt UI Development
03 - Qt UI Development03 - Qt UI Development
03 - Qt UI Development
 
No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
2011.jtr.pbasanta.
2011.jtr.pbasanta.2011.jtr.pbasanta.
2011.jtr.pbasanta.
 
JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple Languages
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
SystemC Ports
SystemC PortsSystemC Ports
SystemC Ports
 
opt-mem-trx
opt-mem-trxopt-mem-trx
opt-mem-trx
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering
 
Thread and method_2010
Thread and method_2010Thread and method_2010
Thread and method_2010
 
Vc4c development of opencl compiler for videocore4
Vc4c  development of opencl compiler for videocore4Vc4c  development of opencl compiler for videocore4
Vc4c development of opencl compiler for videocore4
 

En vedette (9)

Bangalore march07
Bangalore march07Bangalore march07
Bangalore march07
 
Roy aerofone power_verif
Roy aerofone power_verifRoy aerofone power_verif
Roy aerofone power_verif
 
Ludden q3 2008_boston
Ludden q3 2008_bostonLudden q3 2008_boston
Ludden q3 2008_boston
 
Schulz dallas q1_2008
Schulz dallas q1_2008Schulz dallas q1_2008
Schulz dallas q1_2008
 
Strickland dvclub
Strickland dvclubStrickland dvclub
Strickland dvclub
 
Lacey coverage dallas-june20_2006
Lacey coverage dallas-june20_2006Lacey coverage dallas-june20_2006
Lacey coverage dallas-june20_2006
 
Shultz dallas q108
Shultz dallas q108Shultz dallas q108
Shultz dallas q108
 
Duurzaam open data in almere
Duurzaam open data in almereDuurzaam open data in almere
Duurzaam open data in almere
 
Zhang rtp q307
Zhang rtp q307Zhang rtp q307
Zhang rtp q307
 

Similaire à Tierney bq207

Design Verification Using SystemC
Design Verification Using SystemCDesign Verification Using SystemC
Design Verification Using SystemC
DVClub
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
AOE
 

Similaire à Tierney bq207 (20)

Design Verification Using SystemC
Design Verification Using SystemCDesign Verification Using SystemC
Design Verification Using SystemC
 
Modeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationModeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice Simulation
 
Live Updating Swift Code
Live Updating Swift CodeLive Updating Swift Code
Live Updating Swift Code
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
How to Connect SystemVerilog with Octave
How to Connect SystemVerilog with OctaveHow to Connect SystemVerilog with Octave
How to Connect SystemVerilog with Octave
 
PhD Slides
PhD SlidesPhD Slides
PhD Slides
 
Megamodeling of Complex, Distributed, Heterogeneous CPS Systems
Megamodeling of Complex, Distributed, Heterogeneous CPS SystemsMegamodeling of Complex, Distributed, Heterogeneous CPS Systems
Megamodeling of Complex, Distributed, Heterogeneous CPS Systems
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
 
A TypeScript Fans KotlinJS Adventures
A TypeScript Fans KotlinJS AdventuresA TypeScript Fans KotlinJS Adventures
A TypeScript Fans KotlinJS Adventures
 
Verifikation - Metoder og Libraries
Verifikation - Metoder og LibrariesVerifikation - Metoder og Libraries
Verifikation - Metoder og Libraries
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
한컴MDS_Virtual Target Debugging with TRACE32
한컴MDS_Virtual Target Debugging with TRACE32한컴MDS_Virtual Target Debugging with TRACE32
한컴MDS_Virtual Target Debugging with TRACE32
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
The CppCat Analyzer Checks TortoiseGit
The CppCat Analyzer Checks TortoiseGitThe CppCat Analyzer Checks TortoiseGit
The CppCat Analyzer Checks TortoiseGit
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015
 
Bluespec @waseda
Bluespec @wasedaBluespec @waseda
Bluespec @waseda
 
[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 

Plus de Obsidian Software (20)

Zehr dv club_12052006
Zehr dv club_12052006Zehr dv club_12052006
Zehr dv club_12052006
 
Yang greenstein part_2
Yang greenstein part_2Yang greenstein part_2
Yang greenstein part_2
 
Yang greenstein part_1
Yang greenstein part_1Yang greenstein part_1
Yang greenstein part_1
 
Williamson arm validation metrics
Williamson arm validation metricsWilliamson arm validation metrics
Williamson arm validation metrics
 
Whipp q3 2008_sv
Whipp q3 2008_svWhipp q3 2008_sv
Whipp q3 2008_sv
 
Vishakantaiah validating
Vishakantaiah validatingVishakantaiah validating
Vishakantaiah validating
 
Validation and-design-in-a-small-team-environment
Validation and-design-in-a-small-team-environmentValidation and-design-in-a-small-team-environment
Validation and-design-in-a-small-team-environment
 
Tobin verification isglobal
Tobin verification isglobalTobin verification isglobal
Tobin verification isglobal
 
The validation attitude
The validation attitudeThe validation attitude
The validation attitude
 
Thaker q3 2008
Thaker q3 2008Thaker q3 2008
Thaker q3 2008
 
Thaker q3 2008
Thaker q3 2008Thaker q3 2008
Thaker q3 2008
 
Stinson post si and verification
Stinson post si and verificationStinson post si and verification
Stinson post si and verification
 
Shreeve dv club_ams
Shreeve dv club_amsShreeve dv club_ams
Shreeve dv club_ams
 
Sharam salamian
Sharam salamianSharam salamian
Sharam salamian
 
Schulz sv q2_2009
Schulz sv q2_2009Schulz sv q2_2009
Schulz sv q2_2009
 
Salamian dv club_foils_intel_austin
Salamian dv club_foils_intel_austinSalamian dv club_foils_intel_austin
Salamian dv club_foils_intel_austin
 
Sakar jain
Sakar jainSakar jain
Sakar jain
 
Runner sv q307
Runner sv q307Runner sv q307
Runner sv q307
 
Roy omap validation_dvc_lub_092106
Roy omap validation_dvc_lub_092106Roy omap validation_dvc_lub_092106
Roy omap validation_dvc_lub_092106
 
Robert page-abstract
Robert page-abstractRobert page-abstract
Robert page-abstract
 

Tierney bq207

  • 1. Experiences with SystemC Design Verification Using SystemC Greg Tierney Presented to DV Club, Boston March 5, 2007 DV Club, Boston
  • 2. Experiences with SystemC About Avid Invented digital video editing Headquartered in Tewksbury – http://www.avid.com/company/ Products – Film/Video Editing and Finishing – Audio – Broadcast – Animation – Storage & Workgroups – Digital Asset and Production Management Services – Support – Training – Consulting DV Club, Boston
  • 3. Experiences with SystemC Agenda What is SystemC? Why did Avid choose to use SystemC? DV problems solved by SystemC. Summary DV Club, Boston
  • 4. Experiences with SystemC What is SystemC? Provides hardware constructs and a simulation kernel for C++ It is a class library – And it is a language standard (IEEE 1666TM 2005) It has utilities and constructs – Data types, ports, channels, processes Adopted by different disciplines – Architectural Modeling (SoC, performance) – DV (RTL simulation, HW/SW co-verification) – Synthesis It is open source (OSCI) – http://www.systemc.org DV Club, Boston
  • 5. Experiences with SystemC Why Avid Chose SystemC Enhanced existing C++ DV code – Replaced an unreliable in-house framework • Signal encapsulation • Thread management • Random seed management – Smooth transition from C++ to SystemC Tool availability – Single kernel multi-language simulator Industry acceptance Low cost Came with built-in verification capabilities DV Club, Boston
  • 6. Experiences with SystemC Agenda What is SystemC? Why did Avid choose to use SystemC? DV problems solved by SystemC. Summary DV Club, Boston
  • 7. Experiences with SystemC Crossing Language Boundaries Connect an entire HDL module to the testbench. – Wrap the module with a SystemC class (sc_foreign_module). – Provide a string mapping for each port. Connect a foreign signal anywhere in the hierarchy. – Bind a sc_signal (observe_foreign_signal). – Provide a string of hierarchical path to wire or reg. DV Club, Boston
  • 8. Experiences with SystemC Code Examples class MyDUT : public sc_foreign_module { SC_MODULE(MyVTB) public: { sc_in<sc_logic> reset; public: sc_in<sc_logic> clock; sc_out<sc_lv<16> > AD; SC_CTOR(MyVTB) : MyDUTInst(“MyDUTInst”, “MyDUT”), MyDUT(sc_module_nam nm, const char* hdl_name) MyMonitorInst(“MyMonitorInst”, : sc_foreign_module(nm, hdl_name), “MyVTB.MyDUTInst.FooInst”) reset(“reset”), { clock(“clock”), AD(“AD”){} MyDUTInst.reset(tb_reset); }; MyDUTInst.clock(tb_clock); MyDUTInst.AD(tb_AD); class MyMonitor : public sc_module { } public: private: MyMonitor(sc_module_name, MyDUT MyDUTInst; const string& path2DUT){ MyMonitor MyMonitorInst; string path2sig = path2DUT + “.snoop”; snoopSig_.observe_foreign_signal(path2sig); sc_signal<sc_logic> tb_reset; SC_THREAD(threadT); sc_signal<sc_logic> tb_clock; sensitive << sc_signal<sc_lv<16> > tb_AD; snoopSig_.value_changed_event(); }; } private: sc_signal<sc_logic> snoopSig_; void threadT(); }; DV Club, Boston
  • 9. Experiences with SystemC Issues with Binding No clear standard for language boundary resolution. – Each vendor has its own implementation. – Implementation we use doesn’t map arrays or records (yet). Supporting foreign interface requires two pass compilation. – First pass creates object files. – Second pass builds a symbol library used in design elaboration. DV Club, Boston
  • 10. Experiences with SystemC SystemC Connections p start() p start() Call a public method Connect sc_port to a via pointer to object sc_export outp write() read() inp Connect sc_port to a channel DV Club, Boston
  • 11. Experiences with SystemC Code Examples struct start_stop_if : public sc_interface SC_MODULE(MyTest){ { public: virtual void start()=0; sc_port<start_stop_if> bfm_port; virtual void stop()=0; }; }; SC_MODULE(vtb){ public: class MyBFM : SC_CTOR(vtb); public sc_module, private: public virtual start_stop_if sc_signal<sc_logic> Clock; { sc_signal<sc_logic> Request; public: sc_signal<sc_lv<16> > AD; sc_in<sc_logic> Clock; tlm::tlm_fifo<MyX> MyXReceiveChan; sc_out<sc_logic> Request; MyTest MyTestInst; sc_in<sc_lv<16> > AD; MyBFM MyBFMInst; tlm::tlm_put_port<MyX> MyXReceivePort; }; sc_export<start_stop_if> StartStopExport; vtb:vtb(sc_module_name) : void start(); MyBFMInst(“MyBFMInst”), MyTestInst(“MyTestInst”) void stop(); { MyBFMInst.Clock(Clock); SC_CTOR(MyBFM){ MyBFMInst.Request(Request); StartStopExport(*this); MyBFMInst.AD(AD); } MyBFMInst.MyXReceivePort(MyXReceiveChan); }; MyTestInst.bfm_port(MyBFMInst.StartStopExport); } DV Club, Boston
  • 12. Experiences with SystemC Issues with Connections Construction and binding are separate steps. – Ports must be public. – Ports bound after modules and channels are constructed. Binding uses “strict type checking”. – Compilation will fail if type mismatch in the connection. – Splitting a vector across multiple ports is complicated. Binding errors detected at elaboration. – Simulation should abort at runtime if a port is not bound. – Need to assign attributes to port (e.g. # of connections). DV Club, Boston
  • 13. Experiences with SystemC Randomization Separate library dedicated to verification constructs (SCV). Robust, rich feature set for randomization. – Simple constraints (ranges and lists). – Complex constraint solver. – Thread-safe seeding. – Extendible to custom object types. DV Club, Boston
  • 14. Experiences with SystemC Randomization at Avid SCV more than we needed. – So, we use a subset of the features. Provide a Tcl interface to apply constraints. – Wrap scv_smart_ptr. – Define string representations for simple constraints. – Recompilation not required to change constraints. – Reapply constraints over course of simulation. DV Club, Boston
  • 15. Experiences with SystemC Processes Hardware is inherently parallel. DV must be multi-threaded. SystemC solves this with processes. – Macros: SC_THREAD and SC_METHOD. – Events, mutexes, semaphores. – Dynamic processes (sc_spawn). DV Club, Boston
  • 16. Experiences with SystemC Hierarchy SystemC defines an object hierarchy. – Relates objects (parent/child). – Familiar to HDL design. Avid DV defines a layer hierarchy. – Relates connections. – Familiar to communication stacks. Issue: SystemC is not a methodology. DV Club, Boston
  • 17. Experiences with SystemC Example Hierarchy VTOP VTEST Test Translator Reference Model Scoreboard VTB TLM Agent STIMGEN Analysis Agent Analysis Agent Commander_BFM TX_BFM Snooper_BFM RX_BFM Driver Monitor Driver Monitor Monitor Monitor DUT DV Club, Boston
  • 18. Experiences with SystemC Agenda What is SystemC? Why did Avid choose to use SystemC? DV problems solved by SystemC. Summary DV Club, Boston
  • 19. Experiences with SystemC Additional Issues Compile and link performance is disappointing. – Overuse of C++ templates in library. – Partially attributed to vendor implementation. Libraries are huge. Being a language standard has tool implications. C++ learning curve. – C++ code debug very different than HDL. • Segmentation faults, stack traces, code stepping Think like a HW engineer, code like a SW engineer. DV Club, Boston
  • 20. Experiences with SystemC Avid’s Experience Used reliably for nearly 3 years. Runtime performance very satisfactory. Provides opportunity to assist product development beyond DV. – Evaluate architectures and predict performance. – Create programmer’s view models for emulation and HW/SW co-verification. DV Club, Boston