HW/SW Codesign Exercise 7: SystemC · 2019. 1. 7. · HW/SW Codesign Exercise 7: SystemC Yun Cheng...
Transcript of HW/SW Codesign Exercise 7: SystemC · 2019. 1. 7. · HW/SW Codesign Exercise 7: SystemC Yun Cheng...
1Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
HW/SW Codesign
Exercise 7:
SystemC
14. November 2018
2Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Overview
• Understand SystemC concepts through
code
• Discuss the SystemC code
• Discuss the outputs of the different
exercises
• Some slides based on UC Berkeley Tutorial:https://embedded.eecs.berkeley.edu/research/hsc/class/ee249/lectures/l10-SystemC.pdf
3Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Basic components of SystemC code
• sc_main
• module
• process (threads, methods)
• channel
• interface
4Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
FIFO Communication Example
5Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Top1
Top Module
6Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Top Module Declaration
7Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
The FIFO Example
Top1
Producer Consumer
main main
8Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Producer/Consumer Declarations
9Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Top1
Producer Consumer
main main
FIFO
FIFO Channel
10Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
FIFO Channel
11Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Top1
FIFO Interfaces
Producer Consumer
main main
FIFO
12Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Interface Declaration
13Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Top1
The FIFO Example
Producer Consumer
main main
write read
read_event
write_event
FIFO
14Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
FIFO Implementation
15Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Top1
The FIFO Example
Producer Consumer
main main
write read
read_event
write_event
FIFO
modules
processes
channels
ports +
interfaces
events
interfaces
16Swiss FederalInstitute of Technology
Computer Engineeringand Networks Laboratory
Let’s run the code!
1. Download SystemC package from course
website
2. Compile SystemC 2.3
3. Run sample file
4. Add tracing
5. Analyze trace files