A SystemC-based methodology for the simulation of dynamically reconfigurable embedded systems
Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)
description
Transcript of Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)
![Page 1: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/1.jpg)
Functional Verification ofDynamically Reconfigurable Systems(Version 2.3b)
Mr. Lingkan (George) Gong, Dr. Oliver Diessel The University of New South Wales, Australia
![Page 2: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/2.jpg)
2
Outline
• Objectives & Motivation• Challenges in Verifying Dynamically
Reconfigurable Systems (DRS)• Proposed Solution: The ReSim Library• Example Designs• Conclusions
![Page 3: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/3.jpg)
3
Objectives & Motivation
• Dynamically Reconfigurable Systems (DRS)– Improved flexibility– Better resource utilization
![Page 4: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/4.jpg)
4
Objectives & Motivation• Functional Verification
– Bottleneck of all hardware designs– Most costly bugs occur in system integration stage– DRS designs Involve activities that don’t exist in static designs (e.g., module swapping, … )
• It is essential to perform simulation-based verification of Dynamically Reconfigurable Systems (DRS)1 bug/6 lines of RTL code
![Page 5: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/5.jpg)
5
Objectives & Motivation
• “Partial Reconfiguration itself can not be simulated … ”– Xilinx UG702 (Partial Reconfiguration User Guide) – Can simulate Static + A; Static +B; But not the process of
swapping out A and swapping in B
• Objective– Support the simulation of the reconfiguration process– Support the simulation and functional verification of integrated
Dynamically Reconfigurable Systems (DRS)
Dynamically ReconfigurableSystem (Static part)
Dynamic part:Module A
Dynamic part: Module B
Dynamic part:Module B
![Page 6: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/6.jpg)
6
Objectives & Motivation
• Focus on detecting functional bugs– e.g. Cycle mismatch– Assuming there is no timing violation, no errors in the bitstream,
no glitch in the reconfiguration process
• Focus on systematic verification– Correctly verified sub-systems, while necessary, are not sufficient– Recommend to simulate the design BEFORE running it on the
target device
![Page 7: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/7.jpg)
7
Challenges in Verifying DRS
• DRS-specific design considerations
Configuration Port (e.g. ICAP)
Configuration Memory
FPGA Fabric
User Design
application data
Staticmodule
Reconfigurablemodule B
Reconfigurablemodule A
bitstream transfer
bitstream data
potential trafficcontention Reconfigurable
module A
Reconfigurablemodule B
swap modulesaccording to the bitstreams
Disable , isolate, restart
![Page 8: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/8.jpg)
8
Challenges in Verifying DRS• DRS-specific bugs
– BEFORE Reconfiguration Handshake errors (e.g., deadlock) Fail to save module state …
– DURING Reconfiguration: Errors in bitstreams (e.g., if a design “assemble” bitstreams at run time, bugs can be introduced to the
generated bitstreams) Errors in transferring bitstreams (e.g., traffic contention, encryption …) Fail to isolate the module undergoing reconfiguration …
– AFTER Reconfiguration Errors in resetting the module Errors in state restoration …
![Page 9: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/9.jpg)
9
Challenges in Verifying DRS
• Accuracy v.s. Productivity– Simulation accuracy Modeling the entire FPGA fabric
Configuration Port (e.g. ICAP)
Configuration Memory
FPGA Fabric
User Design
application data
Staticmodule
Reconfigurablemodule B
Reconfigurablemodule A
bitstream data
Models for the FPGA fabric not available Even if available, it is not efficient to simulate the FPGA
fabric (Low Productivity)
![Page 10: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/10.jpg)
10
Challenges in Verifying DRS
• Accuracy v.s. Productivity– Simulation productivity DO NOT model the FPGA fabric
User Design
application data
Staticmodule
Reconfigurablemodule B
Reconfigurablemodule A
Does not model bitstream traffic Assume zero or constant reconfiguration delay Does not trigger module swapping Does not model spurious module outputs Low accuracy
??
??
????
![Page 11: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/11.jpg)
11
Challenges in Verifying DRS
• Accuracy v.s. Productivity– Simulation accuracy DO model the FPGA fabric– Simulation productivity DO NOT model the FPGA fabric
• It is essential to balance “accuracy” & “productivity” when simulating partial reconfiguration
![Page 12: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/12.jpg)
12
ReSim
• Core idea– Model the fabric at such a level of detail that is just
enough for RTL simulation of DRS
User Design
application data
Staticmodule
configuration_port : artifact
extended_portal:artifact
Simulation-only Layer
Reconfigurablemodule B
Reconfigurablemodule A
Simulation-only bitstream (SimB)
bitstream transfer
potential trafficcontention
switch moduleaccording to SimB
Errorsource
During reconfiguration, inject errors to the static region
"activate" the new module if and only if the all bytes of the bitstream is successful transferred
![Page 13: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/13.jpg)
13
ReSim
• Simulation-only bitstreams (SimB)– Capture the essence of a real bitstream, but with reduced
size
DRS_DESIGN_TOP
RR0
RM0
RM1
RR1 RM0 RM1 RM2 RM3
RR2 RM0
Module B
Module A
* Use module ID, region ID as Frame Address
* Use ReSim-specificfields as configurationdata
bottom-half
top-half
con
figu
rati
on c
olu
mn
configuration row
RA
CA
FPGA_FLOOR_PLAN
CLB
s
![Page 14: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/14.jpg)
14
ReSim• Capabilities and Limitations
– BEFORE Reconfiguration Handshake errors (e.g., deadlock) Fail to save module state …
– DURING Reconfiguration: Errors in bitstreams (e.g., if a design “assemble” bitstreams at run time, bugs can be introduced to the
generated bitstreams) Errors in transferring bitstreams (e.g., traffic contention, encryption …) Fail to isolate the module undergoing reconfiguration …
– AFTER Reconfiguration Errors in resetting the module Errors in state restoration …
RED: Only on Target deviceBLUE: Only by ReSimGRAY: More Efficient by ReSim
![Page 15: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/15.jpg)
15
ReSim
• Capabilities and Limitations– ReSim assists in testing fabric-independent part of the
design– After simulation, test & debug fabric-dependent part on
the target device (using Chipscope)
![Page 16: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/16.jpg)
16
ReSim
• Reusability– Codegen: automatic generation of artifacts– OO: override the default behavior of artifacts
CodeGeneration
HDL (VHDL/Verilog) Simulation-only Layer
(SystemVerilog)HDL (VHDL/Verilog)
Implementation using FPGA tools
FunctionalSpecification
Simulation using the ReSim library
.tcl script (parameter description file)
namespace import ReSim::*
# interface signalscreate_portmap "my_if" "clk"add_port "my_if" "rst_n" inadd_port "my_if" "data" out 32…# module namescreate_region "my_region" "my_if" ...add_module "my_region" "Maximum"add_module "my_region" "Swap"…# target device familycreate_device "my_device" VIRTEX4
![Page 17: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/17.jpg)
17
Example Designs
• Example Designs– XDRS.QUICKSTART– XDRS.SINGLE– XDRS.MULTIPLE– FPCIe– State_Migration
• Derived from ReSim case studies– See “ReSim Case Studies” for more information on development progress,
bugs detected and lessons learned.
![Page 18: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/18.jpg)
18
Example Design: XDRS
• XDRS: a generic DRS computing platform– Similar to Erlangen Slot Machine, a general-purpose
reconfigurable compute engine (Bobda et al. FCCM 2005)
Reconfigurable Region
Reconfiguration Controller: ICAPI
Producer
ICAP
Memory Interface
Isolation
application data
bitstream
reqn, ackn
Off-chip Memory
Maximum/Reverse
XDRS Specification (Partial Reconfiguration part) ======================== BEFORE Reconfiguration. (Synchronization) - use a reqn/ackn signals to handshake - not acknowledge until RM is IDLE
DURING Reconfiguration. (Isolation) - use an isolation module to drive default values to the static region
AFTER Reconfiguration. (Initialization) - reset the newly-configured RM
![Page 19: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/19.jpg)
19
Example Design: XDRS
• Example simulation waveform– @t1: Sync, @t2: Transfer a bitstream, @t3: Extract
RRID/RMID@t4: Inject errors, @t5: Swap module, @t6: Reset
![Page 20: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/20.jpg)
20
Example Design: XDRS
• Example bug that was detected– Hold the "reset" signal of a module during reconfiguration
producer_ready
consumer_ready
consumer_error
Module A/BProducer
producer_ready
consumer_ready
consumer_error
Isola
tion
producer_ready
consumer_ready
consumer_error
x
x
0
0
0
1
Normal operation:Transfer is successful
Normal operation:Transfer is cancelled
Bug 1:Outputs not isolated during reconfiguration
Bug 2:Transfer is not cancelled during reconfiguration
Correct:Assert consumer_error during reconfiguration
![Page 21: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/21.jpg)
21
Example Design: XDRS
• Regression and coverage analysis
![Page 22: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/22.jpg)
22
Example Design: FPCIe• FPCIe
– Derived from Fast PCIe configuration (XAPP883) ~3500 lines of Verilog code + Coregen code (the PCIe endpoint)
– Integrate ReSim with the original testbench 150 lines of Tcl script (120 IO signals) 10 lines of Verilog code to instantiate the generated artifacts 110 lines of Verilog code to send SimBs to the DUT
ICAPPR Loader
Sw
itch
er
Reconfigurable Region:
PCIe core application: Bus-master DMA
PCIe endpoint
Shared datapath betweenapplication data &bitstream data
![Page 23: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/23.jpg)
23
Example Design: FPCIe
• Example simulation waveform– @t1: Transfer a bitstream over PCIe, @t2: Swap module,
@t3: Application logic starts operating
![Page 24: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/24.jpg)
24
Example Design: State_Migration
• State_Migration– Derived from Microprocessor Peripheral reconfiguration
(UG744)– Modified the hardware to use PPC440 & xps_icapi– Modified the software to save RM state via ICAP
The modified software is composed of fabric-independent C code and fabric-dependent C code
xps_mathxps_icapi
DDR2 Memory
ICAP
Reconfigurable Region: Adder / Maximum
xps_uart
To host PC
microprocessor bus:PLBv46
PPC440microprocessor
periodic application
xps_math driverxps_icapi driver
ReSimVirtex-5
Software
SW: fabric-independent partSW: V5 & ReSim
![Page 25: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/25.jpg)
25
Example Design: State_Migration
• Example simulation waveform– @t1: Read ICAP IDCODE (ReSim’s IDCODE=0x0c1b2011)
@t2: Issue GCAPTURE@t3: Configuration readback
![Page 26: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/26.jpg)
26
Conclusions
• Accuracy v.s. Productivityproductivity
accuracy
High-level modelinge.g. C/C++/SystemC
RTL simulatione.g. Verilog/VHDL
Timing simulation(i.e., simulating the design netlist)
Fabric-accurate simulation(i.e., simulating the FPGA fabric)
+
+
+x
x
ReChannelOSSS+R
VMUXDCS
x
+ Static designs
x DRS designs
xReSim
ReSim is - more productive than fabric-accurate simulation- more accurate than MUX-based simulation
![Page 27: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/27.jpg)
27
Conclusions
• It is essential to simulate partial reconfiguration– Activities such as bitstream traffic, triggering condition, state saving and restoration,
isolation of the reconfigurable region, …
• It is essential to balance accuracy & productivity– Modeling the FPGA fabric is not productive– MUX-based simulation is not accurate
• ReSim– Models the fabric at such a level of detail that is just enough for RTL simulation of DRS– A reusable simulation library
![Page 28: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/28.jpg)
28
More Infomation
• ReSim Home Page– http://code.google.com/p/resim-simulating-partial-reconfiguration/
• ReSim Document– ReSim User Guide– ReSim Case Studies
• Contact– Mr. Lingkan Gong,
http://code.google.com/p/resim-simulating-partial-reconfiguration/wiki/Lingkan_Gong – Dr. Oliver Diessel, http://www.cse.unsw.edu.au/~odiessel/
![Page 29: Functional Verification of Dynamically Reconfigurable Systems (Version 2.3b)](https://reader036.fdocuments.in/reader036/viewer/2022062801/5681440a550346895db09f2c/html5/thumbnails/29.jpg)
29
Thank you