Lecture4 PDF
Lecture4 PDF
EECS 222:
Embedded System Modeling
Lecture 4
Rainer Dömer
Lecture 4: Overview
• Review
– Behavioral hierarchy
• Introduction to the SpecC Language (Part 2)
– Communication and synchronization
– Timing
– Library support
– Persistent annotation
• Homework Assignment 2
– Setup the SpecC compiler and simulator
– Run simple examples
– Create producer-consumer example
b2 b3 b4 b2 b2
b3 b5 b6 b3 b3
b b
e1 e2 e1 e2
a1 a2 i1 i2
v1
B v2
v3
S R
Shared memory
C
v1 v1
B v2 B v2
v3 v3
S R S R
C C1
v1 v1
B v2 B v2 B C2
v3 v3
S R S R S R
#include <stdio.h>
#include <stdlib.h>
import “Interfaces/I1”;
import “Channels/PCI_Bus”;
import “Components/MPEG-2”;
...
Homework Assignment 2
• Task: Introduction to SpecC Compiler and Simulator
• Steps
– Setup the SpecC compiler scc
• source /opt/sce/bin/setup.csh
– Use scc to compile and simulate some simple examples
• scc HelloWorld -vv
• See man scc for the compiler manual page
– Build and simulate a Producer-Consumer example
• See slide 8 for reference
• Producer Prod should send string “Beans and Potatoes”
character by character to the consumer Cons
• Both print the sent/received characters to the screen
• Deliverables
– Source and log file: ProdCons.sc, ProdCons.log
• Due
– January 15, 2019, 6pm