Professional Documents
Culture Documents
Slides from: - Tony Givargis, Irvine, IC253 - Rabi Mahapatra, Texas A&M University - Sharif University
Test-vector Generator
Partial simulation
May not catch all errors
1984, Pentium fdiv error
Output Monitor
Pass/fail
3
Abstraction levels
Event driven simulation:(gate level simulation)
Most accurate as every active signal is calculated for every device during the clock cycle as it propagates Each signal is simulated for its value and its time of occurrence Excellent for timing analysis and verify race conditions computation intensive and hence very slow
Cycle-based simulation:
Calculate the state of the signals at clock edge(0 or 1) suitable for complex design that needs large number of tests 10 times faster than event driven simulation, 20% area efficient
Abstraction levels
Data-Flow Simulator
Signals are represented as stream of values without notion of time. Functional blocks are linked by signals. Blocks are executed when signals present at the input.
Scheduler in the simulator determines the order of block executions. High level abstraction simulation used in the early stages of verification, typically to check the correctness of the algorithms.
Reduced confidence
1 msec of cruise controller operation tells us little
Faster simulator
Emulators
Special hardware for simulations
HW/SW Co-Simulation
Software is traditionally fully tested after hardware is fabricated => long TTM Integrating HW and SW earlier in the design cycle => better TTM Co-simulation involves
Simulating a processor model along with custom hw (usually described in HDL)
High-level Co-simulation
Functional (untimed) simulation allows one to:
check functional (partial) correctness, by generating inputs and observing outputs debug the design, by easy access to internal states
HW/SW Co-Simulation
Variety of simulation approaches exist
From very detailed (e.g., gate-level model) To very abstract (e.g., instruction-level model)
11
HW/SW Co-Simulation
Simple/naive way
HDL model of microprocessor runs system software HDL models of specific-purpose processors Integrate all models
Hardware-software co-simulator
ISS model of microprocessor runs system software HDL model of specific-purpose processors Create communication between simulators Simulators run separately except when transferring data
12
HW/SW Co-Simulation
Heterogeneous co-simulation environments (C-VHDL or C-Verilog)
RPC or another form of inter-process communication between HW and SW simulators High overhead due to high data transmission between the simulators
13
HW
SW
Claims to be actual co-simulation strategy as it affords better ability to match the task with the tool, simulates at the level of details. Synopsiss Eaglei: let hw run in many simulators, sw on native PC/workstation or in instruction-set-simulator (ISS). Eaglie tool interfaces all these.
14
Heterogeneous co-simulation
Homogenous/Heterogenous
Product SW ISS (optional) Product SW
compute
Co-sim glue logic
VHDL Verilog
HW Implementation
Simulation algorithm
Event Cycle Dataflow
PC
Heterogeneous co-simulation
How about performance?
Complex enough to describe any situation Since software is not running at hardware simulation speed, a better performance will be obtained.
If target CPU is not PC, you may use cross compiler When software runs directly on PC/WS, runs at the speed of WS When software can not run directly as processes on WS, you need instruction set simulator ( ISS interprets assembly language at instruction level as long as CPU details are not an issue)
ISS usually runs at 20% of the speed of actual or native processes.
16
17
Emulation
Special simulation environment with hardware
runs whole design expensive 10% of real time FPGA arrays may be the hardware allow designers of large products to find a class of problem that cannot be found in simulation
can attach to real devices (router using Quickturn's Ethernet SpeedBridge could route real network traffic)
18
Emulation
Architectural simulators overlook hardware complexity and lack accuracy Integration of HDL models with architecture level simulator is pretty slow Best solution is to implement the Subsystem under Test in FPGA and integrate this with the architecture level simulator
19
FPGA/ASIC
Simulator
Strategy
Simulation speed: Degrades when real components replace the functional blocks. The simulation speed depends on simulation engine, the simulation algorithm, the number of gates in the design, and whether the design is primarily synchronous or asynchronous Low cost cycle based simulation is a good compromise. Since it can not test physical characteristic of a design, event driven simulator may be used in conjunction. Cycle based simulators and emulators may have long compilation. Hence, not suitable for initial tests that needs many changes. Event driven and cycle based simulators have fairly equal debugging environments, all signals are available at all times. Emulators on the other hand, require the list of signals to be traced to be declared at compilation time
21
Strategy
If the next problem can be found in a few microseconds of simulated time, then slower simulators with faster compilation times are appropriate. If the current batch of problems all take a couple hundred milliseconds, or even seconds of simulated time, then the startup overhead of cycle based simulation or even an emulator is worth the gain in run time speed. How about the portability of test benches?
22
Processor Models
Bus Functional Model (BFM) Instruction-Set Simulator (ISS)
23
Hence,
BFM is an abstract model of processor that can be used to verify how a processor interacts with its peripherals
24
25
Instruction-Set Simulator
ISS: a processor model capable of simulating execution of instructions Different types of ISS for different purposes
Usage 1: Verification of applications written in assembly-code
For fastest speed: translate target assembly instructions into host processor instructions
Is not cycle-accurate. Specially for pipelined and superscalar architectures
26
ISS (contd)
Different types of ISS (contd)
Usage 2: Verification of timing and interface between system components Used in conjunction with a BFM ISS should be timing-accurate in this usage
ISS often works as an emulator For performance estimation usage, ISS is to provide accurate cycle-counting To have certain speed improvements, ISS should provide necessary hooks (discussed later)
27
28
ISS may need to provide BFM with certain memory-access functions (discussed later)
29
How to do it?
BFM generates bus clock only when devices on the bus are addressed
31