ESL-Based Full System Simulation Platform - NCKU

Transcription

ESL-Based Full System SimulationPlatform陳中和Department of Electrical EngineeringInstitute of Computer and CommunicationEngineeringNational Cheng Kung UniversityNCKU-CASLab

Term Project-Preparation Lab1: Building QEMU Experiment al Environment LAB 2: Building Linux Operating System Environment Create an environment that boots Linux kernel on ARMRealview EB modeled by QEMU. LAB3: Virtual Machine & Linux Device Driver Design a virtual hardware running in ARM Realview EB andinteracting with Linux device driver and application LAB4: SystemC Module & Full System Simulation usingQEMU-SystemC LAB5: Full System Simulation using QEMU &PlatformArchitect This lab is not included in this year.2NCKU EE CASLab

Proposal Due in three weeks. Proposal report due (11/23) Final report and presentation3NCKU EE CASLab

Electronic System Level Design Traditional VLSI design flow Software debug begins at late hour.System DesignHardware DesignHardware VerificationPrototype BuildSoftware DesignSoftware CodingSoftware DebugProject Deadline4NCKU EE CASLab

ESL Early interaction with softwareSystem DesignHardware DesignHardware VerificationPrototype BuildSoftware DesignSoftware CodingSoftware DebugProject Deadline5NCKU EE CASLab

What is Full System Simulation Full system simulation platform Hardware : processor cores, memories,interconnection buses, and peripheraldevices, ASICs, co-processor, etc. Software : operating system, devicedrivers, and applications6NCKU EE CASLab

Why full system simulation? Higher abstraction level, higher productivity. Make verification and optimization of complex systems possible.Validate specificationrequirementsFunction & PerformanceOptimize HW architectureInterconnect topology, bushierarchy, mem organization, Function VerificationArchitecture ExplorationESLHW/SW Partition& optimizationVirtual Platformfor SW developmentHW offload/accelerationor programs in DSP cores?Multi-thread programmingin multi-core platform7NCKU EE CASLab

One Example TCP/IP offloadsApplicationsHost SystemOperating SystemDevice DriverHOST-SA Interface( PCI-Express, IDE, )PowerI/OPortI/OPHYSystem Accelerator(SA)8DRAMHost Bus AdapterNCKU EE CASLab

Limitation of Current ESL Simulation Tool ESL SystemC simulation tool CoWare Platform Architect Advantages Ready to use processor/bus models Multiple level of abstractions Transaction level Register transfer level Profiling tool Bus utilization, reads/writes, etc. However, Unacceptable OS booting time (half an hour)9NCKU EE CASLab

Acceleration of OS Booting Take apart OS and CPU from ESL tool (CoWare) Use other tool to simulate CPU and to boot OSVirtual machineApplicationsOperating SystemDevice driverBridge interfaceBridge interfaceHardware designSystem-on-chipESL tool (SystemC, HDL)10NCKU EE CASLab

What is a Virtual Machine Broad definition includes all emulation methods thatprovide a standard software interface, such as theJava VM “System Virtual Machines” provide a completesystem level environment at binary ISA VM is an AP of the host OS Underlying HW platform is called the host, and itsresources are shared among the guest VMs11NCKU EE CASLab

Virtual Machine Virtual machine VM-WareVirtual-PCParallel Desktop for MacQEMU (Quick Emulator) QEMU (http://bellard.org/qemu) (C/C ) Open source code Different ISAs support (x86,ARM,MIPS etc) Fast simulation speed (Functional level) QEMU-SystemC (Extension of QEMU) Enable QEMU and SystemC modellingthrough AMBA interface in ARM versatilebaseboard12NCKU EE CASLab

QEMU Architecture QEMU is made of severalsubsystems CPU emulator (e.g. x86, ARM, MIPS) Emulator devices (e.g. VGA, IDE HD) Generic devices (e.g. network devices) Connecting QEMU emulated devices to thecorresponding host devices. Machine descriptions Instantiating the emulated device. Debugger User interface13NCKU EE CASLab

Add New Virtual Hardware QEMU allows us to write a virtualhardware and emulate it Steps Design your virtual machine in Ccode including initialization of the hardware ,low level read/write (commands tohardware) functions for the hardware Design device driver for that hardware14NCKU EE CASLab

A Fast Hybrid Full System Simulation Platform QEMU Boot and run OS with much less time (less 1 min) Only functional simulation CoWare SystemC based simulator & design environment inaddition to C/C , HDL Detailed profiling Booting Linux OS – long booting time Integration (QEMU & CoWare) QEMU runs OS, upon which users develop AP CoWare simulates hardware design Accurate level (RTL) Higher level15NCKU EE CASLab

What is needed? Host Computer Personal computer with Linux OS CoWare Platform Architect v2007.1.2 QEMU QEMU-SystemC v0.9116NCKU EE CASLab

Platform OverviewAPQEMU(C, C )ARM System Emulator (ARM Versatile baseboard )AHB Interface Virtual HardwareQEMU-SystemC WrapperCommunication MechanismHost OS Socket (): for interprocesscommunicationCommunication MechanismVM bridgeinterfaceAPCoWare-SystemC WrapperVM AccessPortMSInterruptControllerDRAMSystemC ModuleSSOn-Chip-Bus ( AHB, AXI, OCP, )MCoWare PA(SystemC, HDL)SPAC17NCKU EE CASLab

QEMU Side Details Simulated machine ARM Versatile baseboard Debian Linux 2.6.18 Integration schemes for QEMU and CoWare AHB interface virtual hardware Character device driver (API) for design in CoWare Interrupt service routineQemu(C, C )ARM System Emulator (ARM Versatile baseboard )ARM926EJSPL190 Vectored Interrupt ControllerFour PL011 UARTsSMC 91c111 Ethernet adapterPL050 KMI with PS/2 keyboard and mouse.AHB Interface Virtual HardwareQemu-SystemC WrapperSocket Interface (Client/Server)18NCKU EE CASLab

CoWare Side Details HardwareSocket Interface (Server/Client)CoWare-SystemC WrapperCoWare(SystemC, HDL) AHB Bus DSP/ASICs Other devices VM interface bridgeVMAccess PortMSInterruptControllerPPACPMSOn-Chip-Bus (AHB,AXI,OCP.)SSDRAMModule VM interface bridge VM access port Read/write data from QEMU AP to slavemodules in CoWare Interrupt controller Bypass interrupt signal to QEMU OS19NCKU EE CASLab

Communication Mechanism Socket call Easy to use Flexible Other ESL simulation tool Multiple computer support20NCKU EE CASLab

System Memory Allocation Allocate physical memory space of CoWarehardware into memory space of QEMU virtualplatform (simulated platform)0QEMU(C, C )ARM System Emulator (ARM Versatile baseboard )AHB Interface Virtual HardwareQEMU-SystemC WrapperSocket InterfaceQemu PhysicalMemory SpaceSocket InterfaceCoWare-SystemC WrapperVM AccessPortMCoWare PhysicalMemory SpaceSInterruptControllerDRAMSystemC ModuleSSOn-Chip-Bus ( AHB, AXI, OCP, )CoWare PA(SystemC, HDL)MSPAC4G21NCKU EE CASLab

Examples of Application Heterogeneous Multi-Core ARM PAC (DSP) GPU (OpenGL/ES) Multi-viewgeneration Network SCTP/IP offload design22NCKU EE CASLab

DSP Runs FFT Program Develop applications using driver API Use FFT program for example Functions for designer We should open the device first and close the deviceafter using it. IO init() /*standard I/O initialization operation*/IO exit() After opening the device , the FFT main program canuse these functions to call APIs to read/write datafrom/to hardware in CoWare. IO read byte , IO read half , IO read wordIO write byte, IO write half, IO write word23NCKU EE CASLab

Heterogeneous Multi-Core FFT main program runs in QEMU OS First open device using IO init() Send PAC binary and data(fft.img) to CoWare IO write word(0xa0000000, send data) Call function fft() use IO write word to set PAC to run fftuse IO read word to read data calculated by PAC Close the device, use IO exit() Check FFT results24NCKU EE CASLab

FULL SYSTEM VERIFICATION PLATFORM FORMULTI-VIEW GPUQemu(C, C ) OpenGL ES ApplicationDebian GNU/Linux OSDevice driverARM System Emulator (ARM Versatile baseboard ) AHB Interface Virtual HardwareQemu-SystemC WrapperSocket Interface (Client)Socket Interface (Server)Qemu-SystemC WrapperCoWare(SystemC, SMSQEMU OpenGL ES Application Customized device driverSystemC/RTL Co-Simulation GPU core Geometry module Rasterization module Multi-View generation Depth-Image BREngineP25NCKU EE CASLab

GPU in System C GPU with SystemCencapsulationQemu(C, C )glFrustumf(-1.0, 1.0, -1.0, 1.0, 1.0, 20.0);glClear(GL COLOR BUFFER BIT GL DEPTH BUFFERBIT); glTranslatef(0.5, 0.0, -2.0); ugSolidSpheref(1.0f, 24, 24);eglSwapBuffers(eglDisplay,eglSurface);OpenGL ES ApplicationDebian GNU/Linux OSDevice driverARM System Emulator (ARM Versatile baseboard )AHB Interface Virtual HardwareQemu-SystemC WrapperSocket Interface (Client)SystemCSocket Interface (Server)Qemu-SystemC WrapperCoWare(SystemC, NCKU EE CASLab

GPU in fresh RTL modules GPU with RTLencapsulationQemu(C, C )OpenGL ES ApplicationglFrustumf(-1.0, 1.0, -1.0, 1.0, 1.0, 20.0);glClear(GL COLOR BUFFER BIT GL DEPTH BUFFERBIT); glTranslatef(0.5, 0.0, -2.0); ugSolidSpheref(1.0f, 24, 24);eglSwapBuffers(eglDisplay,eglSurface);Debian GNU/Linux OSDevice driverARM System Emulator (ARM Versatile baseboard )AHB Interface Virtual HardwareQemu-SystemC WrapperSocket Interface (Client)Socket Interface (Server)Qemu-SystemC WrapperCoWare(SystemC, HDL)AHBMasterMInterruptControllerPDebugging byAHBcomparing eometryEngineMSMSDIBREngineP27NCKU EE CASLab

100 % FULL SYSTEM VERIFICATION GPU with RTLQemu(C, C )encapsulation RTL verification confirmedOpenGL ES ApplicationDebian GNU/Linux OSDevice driverARM System Emulator (ARM Versatile baseboard )glFrustumf(-1.0, 1.0, -1.0, 1.0, 1.0, 20.0);glClear(GL COLOR BUFFER BIT GL DEPTH BUFFERBIT); glTranslatef(0.5, 0.0, -2.0); ugSolidSpheref(1.0f, 24, 24);eglSwapBuffers(eglDisplay,eglSurface);AHB Interface Virtual HardwareQemu-SystemC WrapperSocket Interface (Client)Socket Interface (Server)Qemu-SystemC WrapperCoWare(SystemC, NCKU EE CASLab

Flexibility QEMU (fast emulator)Qemu(C, C )OpenGL ES Application OpenGL ES benchmarksuite Customized device driverDebian GNU/Linux OSDevice driverARM System Emulator (ARM Versatile baseboard )AHB Interface Virtual Hardware For GPU DIBRQemu-SystemC Wrapper Co-simulationSocket Interface (Client)Socket Interface (Server)Qemu-SystemC WrapperCoWare(SystemC, SModule nameDesign levelAMBA AHBTimed TLMAMBA bridgeTimed TLMSRAMUntimed TLMGeometry EngineRTLRasterizer EngineRTLDIBR gineP29NCKU EE CASLab

SCTP/IP Offload SystemSCTP: Stream Control Transmission ProtocolComputer 1Computer 2Physical Host 1QEMUQEMUVirtual Host 1( O/S, Driver, Application )Virtual Host 2( O/S, Driver, Application )Qemu-SystemCInterfaceQemu-SystemCInterfaceNetwork OffloadEngineNetwork OffloadEngineVirtual MACVirtual MACPhysical Host 2( O/S, Driver,Application )1. Functionalverification2. Connection withreal world(path1)3. Performanceevaluation for10 Gb (path 2)21Virtual NetworkCoWare (SystemC, C/C , HDL)Raw Socket APINIC (Network Interface Card)NICEthernet30NCKU EE CASLab

SCTP/IP Offload System CoWare on PC 1, Host QEMU on PC 2 Network Offload Engine (SCTP, IP, MAC) FTP client (run on your design) talks to FTP server (realworld) Virtual MAC (model bit rates)Computer 1Computer 2QEMUVirtual HostCoWare PAQemu-SystemCInterfaceFTP ClientQemu-SystemCInterfaceNetwork Offload EngineVirtual MACNetwork Interface CardFTP ServerNetwork Interface CardEthernet31NCKU EE CASLab

Network Offload SystemComputer 1Computer 2QEMUVirtual HostCoWare PAQemu-SystemCInterfaceFTP ClientFTP clientQemu-SystemCInterfaceNetwork Offload EngineVirtual MACNetwork Interface CardFTP serverFTP ServerNetwork Interface CardEthernet The FTP client in the virtual platform was uploading files to theserver. The FTP server in the real world computer was receiving datafrom the client. Finally, the files had been received completely at the server.32NCKU EE CASLab

Portability The same memory allocation and OS No need to change device driver andapplication Different OS Only need to change device driver Header files, different system calls No need to change application Different memory allocation Need to change device driver andapplication but only address dependentstatements33NCKU EE CASLab

Performance Issue Simulation overhead Use socket call for communicationbetween QEMU and CoWare Hardware implementation (FPGA) uses nosocket call Performance improvement Reduce communication Rbyte Rbyte Rbyte Rbyte Rword Reconstruct Data flow34NCKU EE CASLab

And in conclusion A full system simulation platform that enablesApplication, Linux operating system, Host processor,and RTL/SystemC design simulation. A convenient and easy-to-use integrated platformfor software/hardware debugging and verification. Applications, drivers, RTLs. An ESL tool that can tackle with designs of highcomplexity. Instruction profiling in QEMU Instruction count (PID-based), type, user/kernel mode Power estimation35NCKU EE CASLab

Virtual-PC Parallel Desktop for Mac QEMU (Quick Emulator) . M emory S pac e C oW are-S ys temC W rapper O n-C hip-B us ( A H B , A X I, O C P , ¹ ) V M A c c es s P ort D R A M S ys temC M odule M S S P A C M S Interrupt C ontroller S S oc ket Interfac e