Design Verification Using SystemC

1,513 views

Published on

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,513
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
46
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Design Verification Using SystemC

  1. 1. DV Club, BostonExperiences with SystemCDesign Verification UsingSystemCGreg TierneyPresented toDV Club, BostonMarch 5, 2007
  2. 2. DV Club, BostonExperiences with SystemCAbout AvidInvented digital video editingHeadquartered in Tewksbury– http://www.avid.com/company/Products– Film/Video Editing andFinishing– Audio– Broadcast– Animation– Storage & Workgroups– Digital Asset and ProductionManagementServices– Support– Training– Consulting
  3. 3. DV Club, BostonExperiences with SystemCAgendaWhat is SystemC?Why did Avid choose to use SystemC?DV problems solved by SystemC.Summary
  4. 4. DV Club, BostonExperiences with SystemCWhat is SystemC?Provides hardware constructs and a simulation kernelfor C++It is a class library– And it is a language standard (IEEE 1666TM 2005)It has utilities and constructs– Data types, ports, channels, processesAdopted by different disciplines– Architectural Modeling (SoC, performance)– DV (RTL simulation, HW/SW co-verification)– SynthesisIt is open source (OSCI)– http://www.systemc.org
  5. 5. DV Club, BostonExperiences with SystemCWhy Avid Chose SystemCEnhanced existing C++ DV code– Replaced an unreliable in-house framework• Signal encapsulation• Thread management• Random seed management– Smooth transition from C++ to SystemCTool availability– Single kernel multi-language simulatorIndustry acceptanceLow costCame with built-in verification capabilities
  6. 6. DV Club, BostonExperiences with SystemCAgendaWhat is SystemC?Why did Avid choose to use SystemC?DV problems solved by SystemC.Summary
  7. 7. DV Club, BostonExperiences with SystemCCrossing Language BoundariesConnect an entire HDL module to thetestbench.– Wrap the module with a SystemC class(sc_foreign_module).– Provide a string mapping for each port.Connect a foreign signal anywhere in thehierarchy.– Bind a sc_signal (observe_foreign_signal).– Provide a string of hierarchical path to wire or reg.
  8. 8. DV Club, BostonExperiences with SystemCCode ExamplesSC_MODULE(MyVTB){public:SC_CTOR(MyVTB) :MyDUTInst(“MyDUTInst”, “MyDUT”),MyMonitorInst(“MyMonitorInst”,“MyVTB.MyDUTInst.FooInst”){MyDUTInst.reset(tb_reset);MyDUTInst.clock(tb_clock);MyDUTInst.AD(tb_AD);}private:MyDUT MyDUTInst;MyMonitor MyMonitorInst;sc_signal<sc_logic> tb_reset;sc_signal<sc_logic> tb_clock;sc_signal<sc_lv<16> > tb_AD;};class MyDUT : public sc_foreign_module {public:sc_in<sc_logic> reset;sc_in<sc_logic> clock;sc_out<sc_lv<16> > AD;MyDUT(sc_module_nam nm, const char* hdl_name): sc_foreign_module(nm, hdl_name),reset(“reset”),clock(“clock”),AD(“AD”){}};class MyMonitor : public sc_module {public:MyMonitor(sc_module_name,const string& path2DUT){string path2sig = path2DUT + “.snoop”;snoopSig_.observe_foreign_signal(path2sig);SC_THREAD(threadT);sensitive <<snoopSig_.value_changed_event();}private:sc_signal<sc_logic> snoopSig_;void threadT();};
  9. 9. DV Club, BostonExperiences with SystemCIssues with BindingNo clear standard for language boundaryresolution.– Each vendor has its own implementation.– Implementation we use doesn’t map arrays orrecords (yet).Supporting foreign interface requires twopass compilation.– First pass creates object files.– Second pass builds a symbol library used indesign elaboration.
  10. 10. DV Club, BostonExperiences with SystemCSystemC ConnectionsCall a public methodvia pointer to objectConnect sc_port to asc_exportConnect sc_port to achannelstart()start()outp inpppwrite() read()
  11. 11. DV Club, BostonExperiences with SystemCCode Examplesstruct start_stop_if : public sc_interface{virtual void start()=0;virtual void stop()=0;};class MyBFM :public sc_module,public virtual start_stop_if{public:sc_in<sc_logic> Clock;sc_out<sc_logic> Request;sc_in<sc_lv<16> > AD;tlm::tlm_put_port<MyX> MyXReceivePort;sc_export<start_stop_if> StartStopExport;void start();void stop();SC_CTOR(MyBFM){StartStopExport(*this);}};SC_MODULE(MyTest){public:sc_port<start_stop_if> bfm_port;};SC_MODULE(vtb){public:SC_CTOR(vtb);private:sc_signal<sc_logic> Clock;sc_signal<sc_logic> Request;sc_signal<sc_lv<16> > AD;tlm::tlm_fifo<MyX> MyXReceiveChan;MyTest MyTestInst;MyBFM MyBFMInst;};vtb:vtb(sc_module_name) :MyBFMInst(“MyBFMInst”), MyTestInst(“MyTestInst”){MyBFMInst.Clock(Clock);MyBFMInst.Request(Request);MyBFMInst.AD(AD);MyBFMInst.MyXReceivePort(MyXReceiveChan);MyTestInst.bfm_port(MyBFMInst.StartStopExport);}
  12. 12. DV Club, BostonExperiences with SystemCIssues with ConnectionsConstruction 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).
  13. 13. DV Club, BostonExperiences with SystemCRandomizationSeparate library dedicated to verificationconstructs (SCV).Robust, rich feature set forrandomization.– Simple constraints (ranges and lists).– Complex constraint solver.– Thread-safe seeding.– Extendible to custom object types.
  14. 14. DV Club, BostonExperiences with SystemCRandomization at AvidSCV 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 simpleconstraints.– Recompilation not required to change constraints.– Reapply constraints over course of simulation.
  15. 15. DV Club, BostonExperiences with SystemCProcessesHardware 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).
  16. 16. DV Club, BostonExperiences with SystemCHierarchySystemC 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.
  17. 17. DV Club, BostonExperiences with SystemCExample HierarchyVTOPVTESTVTBDUTSnooper_BFMMonitor MonitorCommander_BFMDriver MonitorTX_BFMDriverRX_BFMMonitorTLM AgentSTIMGENTranslator Reference ModelAnalysis AgentScoreboardAnalysis AgentTest
  18. 18. DV Club, BostonExperiences with SystemCAgendaWhat is SystemC?Why did Avid choose to use SystemC?DV problems solved by SystemC.Summary
  19. 19. DV Club, BostonExperiences with SystemCAdditional IssuesCompile 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 steppingThink like a HW engineer, code like a SW engineer.
  20. 20. DV Club, BostonExperiences with SystemCAvid’s ExperienceUsed reliably for nearly 3 years.Runtime performance very satisfactory.Provides opportunity to assist productdevelopment beyond DV.– Evaluate architectures and predictperformance.– Create programmer’s view models foremulation and HW/SW co-verification.

×