CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #6 – Model Refinement.

Slides:



Advertisements
Similar presentations
A hardware-software co-design approach with separated verification/synthesis between computation and communication Masahiro Fujita VLSI Design and Education.
Advertisements

SoC Challenges & Transaction Level Modeling (TLM) Dr. Eng. Amr T. Abdel-Hamid ELECT 1002 Spring 2008 System-On-a-Chip Design.
ECOE 560 Design Methodologies and Tools for Software/Hardware Systems Spring 2004 Serdar Taşıran.
High Level Languages: A Comparison By Joel Best. 2 Sources The Challenges of Synthesizing Hardware from C-Like Languages  by Stephen A. Edwards High-Level.
SpecC and SpecCharts Reviewed and Presented by Heemin Park and Eric Kwan EE202A - Fall 2001 Professor Mani Srivastava.
Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
Easy Steps Towards Virtual Prototyping using the SystemVerilog DPI
Addressing the System-on-a-Chip Interconnect Woes Through Communication-Based Design N. Vinay Krishnan EE249 Class Presentation.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
Mahapatra-Texas A&M-Fall'001 cosynthesis Introduction to cosynthesis Rabi Mahapatra CPSC498.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
1 EE249 Discussion A Method for Architecture Exploration for Heterogeneous Signal Processing Systems Sam Williams EE249 Discussion Section October 15,
Interface-based Design Donald Chai EE249. Outline Orthogonalization of concerns Formalisms Interface-based Design Example Cheetah Simulator Future Inroads.
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
1 Embedded Computer System Laboratory RTOS Modeling in Electronic System Level Design.
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
(1) Modeling Digital Systems © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Spring EE 437 Lillevik 437s06-l2 University of Portland School of Engineering Advanced Computer Architecture Lecture 2 NSD with MUX and ROM Class.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Computer Architecture
CAD Techniques for IP-Based and System-On-Chip Designs Allen C.-H. Wu Department of Computer Science Tsing Hua University Hsinchu, Taiwan, R.O.C {
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #7 – System-Level.
Spring EE 437 Lillevik 437s06-l8 University of Portland School of Engineering Advanced Computer Architecture Lecture 8 Project 3: memory agent Programmed.
Extreme Makeover for EDA Industry
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
Section 10: Advanced Topics 1 M. Balakrishnan Dept. of Comp. Sci. & Engg. I.I.T. Delhi.
Compiler & Microarchitecture Lab Support of Cross Calls between Microprocessor and FPGA in CPU-FPGA Coupling Architecture G. NguyenThiHuong and Seon Wook.
1 H ardware D escription L anguages Modeling Digital Systems.
Automatic Communication Refinement for System Level Design Samar Abdi, Dongwan Shin and Daniel Gajski Center for Embedded Computer Systems, UC Irvine
SystemC and Levels of System Abstraction: Part I.
Chonnam national university VLSI Lab 8.4 Block Integration for Hard Macros The process of integrating the subblocks into the macro.
F. Gharsalli, S. Meftali, F. Rousseau, A.A. Jerraya TIMA laboratory 46 avenue Felix Viallet Grenoble Cedex - France Embedded Memory Wrapper Generation.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #21 – HW/SW.
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #4 – Introduction.
- 1 - EE898_HW/SW Partitioning Hardware/software partitioning  Functionality to be implemented in software or in hardware? No need to consider special.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
EEE440 Computer Architecture
Spring EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.
SpecC stands for “specification description language based on C”.
6. A PPLICATION MAPPING 6.3 HW/SW partitioning 6.4 Mapping to heterogeneous multi-processors 1 6. Application mapping (part 2)
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #5 – System-Level.
System-level power analysis and estimation September 20, 2006 Chong-Min Kyung.
Computer Organization CDA 3103 Dr. Hassan Foroosh Dept. of Computer Science UCF © Copyright Hassan Foroosh 2002.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Software Systems Division (TEC-SW) ASSERT process & toolchain Maxime Perrotin, ESA.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
System-on-Chip Design Homework Solutions
CS 286 Computer Organization and Architecture
RTL Design Methodology
IP – Based Design Methodology
Design Flow System Level
Introduction to cosynthesis Rabi Mahapatra CSCE617
RTL Design Methodology
CprE 588 Embedded Computer Systems
CprE 588 Embedded Computer Systems
RTL Design Methodology
RTL Design Methodology Transition from Pseudocode & Interface
RTL Design Methodology
RTL Design Methodology Transition from Pseudocode & Interface
RTL Design Methodology
RTL Design Methodology Transition from Pseudocode & Interface
Synchronization Verification in System-Level Design with ILP Solvers
Computer Systems An Introducton.
Advanced Computer Architecture Lecture 11
Chapter 13: I/O Systems.
Advanced Computer Architecture Lecture 10
Advanced Computer Architecture Lecture 3
Presentation transcript:

CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #6 – Model Refinement

Lect-06.2CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Communication Synthesis Bus allocation / protocol selection Channel partitioning Protocol, transducer insertion Inlining Specification model Architecture model Communication model Implementation model Backend Communication synthesis Architecture exploration R. Domer, The SpecC System-Level Design Language and Methodology, Center for Embedded Systems, University of California-Irvine, 2001.

Lect-06.3CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Bus Allocation / Channel Partitioning B3 B34snd B2 B1 B13snd B34rcv PE1 c2 v1 cb13 cb34 PE2 v1 B13rcv Allocate busses Partition channels Update communication  Additional level of hierarchy to model bus structure Bus1

Lect-06.4CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Channel Partitioning B3 B34snd B2 B1 B13snd B34rcv PE1 v1 PE2 v1 B13rcv c2 cb13 cb34 Bus1

Lect-06.5CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Bus Channel c2 cb13 cb34 IBus Bus1 channel Bus1() implements IBus { ChMP cb13, c2, cb34; void send( BusAddr a, void* d, int size ) { switch( a ) { case CB13: return cb13.send( d, size ); case C2: return c2.send( d, size ); case CB34: return cb34.send( d, size ); } void recv( BusAddr a, void* d, int size ) { switch( a ) { case CB13: return cb13.recv( d, size ); case C2: return c2.recv( d, size ); case CB34: return cb34.recv( d, size ); } }; Hierarchical channel: interface IBus { void send( BusAddr a, void* d, int size ); void recv( BusAddr a, void* d, int size ); }; Bus interface: typedef enum { CB13, C2, CB34 } BusAddr; Virtual addressing: 1

Lect-06.6CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Channel Partitioning behavior B13Snd( in int v1, IBus bus ) { void main(void) { bus.send( CB13, &v1, sizeof(v1) ); } }; bus1.send( CB13, &v1, sizeof(v1) ); IBus bus1 behavior B34Rcv( IBus bus ) { void main(void) { bus.recv( CB34, 0, 0 ); } }; bus1.recv( CB34, 0, 0 ); IBus bus1 behavior B2( in int v1, IBus bus ) { void main(void) {   } }; IBus bus1 bus1.send( C2,  ); Leaf behaviors B2 B1 B13snd B34rcv PE1 v

Lect-06.7CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 After Channel Partitioning (cont.) behavior PE1( IBus bus1 ) { int v1; B1 b1 ( v1 ); B13Snd b13snd( v1, bus1 ); B2 b2 ( v1, bus1 ); B34Rcv b34rcv( bus1 ); void main(void) { b1.main(); b13snd.main(); b2.main(); b34rcv.main(); } }; IBus bus1 bus1 B2 B1 B13snd B34rcv PE1 v

Lect-06.8CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 After Channel Partitioning (cont.) B3 B34snd PE2 v1 B13rcv Leaf behaviors behavior B13Rcv( IBus bus, out int v1 ) { void main(void) { bus.send( CB13, &v1, sizeof(v1) ); } }; bus1.recv( CB13, &v1, sizeof(v1) ); IBus bus1 behavior B34Snd( IBus bus ) { void main(void) { bus.send( CB34, 0, 0 ); } }; bus1.send( CB34, 0, 0 ); IBus bus1 behavior B3( in int v1, IBus bus ) { void main(void) {   } }; IBus bus1 bus1.recv( C2,  );

Lect-06.9CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 After Channel Partitioning (cont.) behavior PE2( IBus bus1 ) { int v1; B13Rcv b13rcv( bus1, v1 ); B3 b3 ( v1, bus1 ); B34Snd b34snd( bus1 ); void main(void) { b13rcv.main(); b3.main(); b34snd.main(); } }; IBus bus1 bus1 B3 B34snd PE2 v1 B13rcv

Lect-06.10CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 After Channel Partitioning (cont.) behavior Design() { Bus1 bus1; PE1 pe1( bus1 ); PE2 pe2( bus1 ); void main(void) { par { pe1.main(); pe2.main(); } } }; B2 B1 B13snd B34rcv PE1 v1 B3 B34snd PE2 v1 B13rcv c2 cb13 cb34 Bus1 bus1 Bus1 bus1;

Lect-06.11CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Insertion c2 cb13 cb34 Bus1 Protocol Layer Application Layer Bus1 Insert protocol layer Protocol channel Create application layer Implement message-passing over bus protocol Replace bus channel Hierarchical combination of application, protocol layers

Lect-06.12CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Example ready ack address[15:0] data[31:0] MasterSlave Double handshake protocol

Lect-06.13CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Example (cont.) ready ack address[15:0] data[31:0] (5, 15)(5, 25) (10, 20)(5, 15) Timing diagram

Lect-06.14CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Layer read y ack address[15:0] data[31:0 ] DblHSProtocol IProtocolMaster IProtocolSlave Protocol channel Encapsulate wires Abstract bus transfers Implement protocol Bus timing

Lect-06.15CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Channel read y ack address[15:0] data[31:0 ] DblHSProtocol IProtocolMaster IProtocolSlave channel DblHSProtocol() implements IProtocolMaster, IProtocolSlave { bit[15:0] address; bit[31:0] data; Signal ready(); Signal ack();  }; interface IProtocolMaster { void masterWrite( bit[15:0] a, bit[31:0] d ); void masterRead( bit[15:0] a, bit[31:0] *d ); }; Master interface: interface IProtocolSlave { void slaveWrite( bit[15:0] a, bit[31:0] d ); void slaveRead( bit[15:0] a, bit[31:0] *d ); }; Slave interface:

Lect-06.16CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Master Interface void masterRead( bit[15:0] a, bit[31:0] *d ) { do { t1: address = a; waitfor( 5 ); // estimated delay t2: ready.set( 1 ); ack.waituntil( 1 ); t3: *d = data; waitfor( 15 ); // estimated delay t4: ready.set( 0 ); ack.waituntil( 0 ); } timing { // constraints range( t1; t2; 5; 15 ); range( t3; t4; 10; 25 ); } void masterWrite( bit[15:0] a, bit[31:0] d ) { do { t1: address = a; data = d; waitfor( 5 ); // estimated delay t2: ready.set( 1 ); ack.waituntil( 1 ); t3: waitfor( 10 ); // estimated delay t4: ready.set( 0 ); ack.waituntil( 0 ); } timing { // constraints range( t1; t2; 5; 15 ); range( t3; t4; 10; 25 ); } ready ack address[15:0] data[31:0] (5, 15)(5, 25) (10, 20)(5, 15)

Lect-06.17CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Protocol Slave Interface void slaveWrite( bit[15:0] a, bit[31:0] d ) { do { t1: ready.waituntil( 1 ); t2: if( a != address ) goto t1; data = d; waitfor( 12 ); // estimated delay t3: ack.set( 1 ); ready.waituntil( 0 ); t4: waitfor( 7 ); // estimated delay t5: ack.set( 0 ); } timing { // constraints range( t2; t3; 10; 20 ); range( t4; t5; 5; 15 ); } void slaveRead( bit[15:0] a, bit[31:0] *d ) { do { t1: ready.waituntil( 1 ); t2: if( a != address ) goto t1; *d = data; waitfor( 12 ); // estimated delay t3: ack.set( 1 ); ready.waituntil( 0 ); t4: waitfor( 7 ); // estimated delay t5: ack.set( 0 ); } timing { // constraints range( t2; t3; 10; 20 ); range( t4; t5; 5; 15 ); } ready ack address[15:0] data[31:0] (5, 15)(5, 25) (10, 20)(5, 15)

Lect-06.18CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Application Layer Implement abstract message-passing over protocol Synchronization Arbitration Addressing Data slicing IProtocolSlave IProtocolMaster DblHSProtocol Application channel IBusSlave IBusMaster

Lect-06.19CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Application Layer (cont.) Behavior Send/receive data block Comm./channel callComputation addr[] data[] ctrl[] Bus transfer Protocol Layer Message-passing Application Layer...Protocol call Bus read/write... intr/pollreq/ackrelease Sync/arbitr.Read/write meta dataArbitrationRead/write data wordsSync ID n data 1 data 2 data m ID 1 ID 2... Bus transfer

Lect-06.20CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Application Layer Channel DblHSBus IProtocolSlave IBusSlave IBusMaster IProtocolMaster DblHSProtocol channel DblHSBus() implements IBusMaster, IBusSlave { DblHSProtocol protocol;  }; interface IBusMaster { void masterSend( BusAddr a, void* d, int size ); void masterRecv( BusAddr a, void *d, int size ); }; Master interface: interface IBusSlave { void slaveSend( BusAddr a, void* d, int size ); void slaveRecv( BusAddr a, void* d, int size ); }; Slave interface:

Lect-06.21CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Application Layer Methods void masterSend( int a, void* d, int size ) { long *p = d; for( ; size > 0; size -= 4, p++ ) { protocol.masterWrite( a, *p ); } void masterRecv( int a, void* d, int size ) { long *p = d; for( ; size > 0; size -= 4, p++ ) { protocol.masterRead( a, p ); } void slaveSend( int a, void* d, int size ) { long *p = d; for( ; size > 0; size -= 4, p++ ) { protocol.slaveWrite( a, *p ); } void slaveRecv( int a, void* d, int size ) { long *p = d; for( ; size > 0; size -= 4, p++ ) { protocol.slaveRead( a, p ); } Master interface:Slave interface:

Lect-06.22CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Protocol Insertion B2 B1 B13snd B34rcv PE1 v1 B3 B34snd PE2 v1 B13rcv DblHSBus IBusSlaveIBusMaster ready ack address[15:0] data[31:0] DblHSProtocol MasterSlave IProtocolSlaveIProtocolMaster

Lect-06.23CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Protocol Insertion (cont.) behavior B13Snd( in int v1, IBusMaster bus1 ) { void main(void) { bus.send( CB13, &v1, sizeof(v1) ); } }; bus1.masterSend(CB13, &v1, sizeof(v1) ); IBusMaster bus1 behavior B34Rcv( IBusMaster bus1 ) { void main(void) { bus.recv( CB34, 0, 0 ); } }; bus1.masterRecv( CB34, 0, 0 ); IBusMaster bus1 behavior B2( in int v1, IBusMaster bus1 ) { void main(void) {   } }; IBusMaster bus1 bus1.masterSend( C2,  ); Leaf behaviors B2 B1 B13snd B34rcv PE1 v

Lect-06.24CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Protocol Insertion (cont.) B2 B1 B13snd B34rcv PE1 v1 behavior PE1( IBusMaster bus1 ) { int v1; B1 b1 ( v1 ); B13Snd b13snd( v1, bus1 ); B2 b2 ( v1, bus1 ); B34Rcv b34rcv( bus1 ); void main(void) { b1.main(); b13snd.main(); b2.main(); b34rcv.main(); } }; IBusMaster bus1 bus

Lect-06.25CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Protocol Insertion (cont.) B3 B34snd PE2 v1 B13rcv Leaf behaviors behavior B13Rcv( IBusSlave bus1, out int v1 ) { void main(void) { bus.slaveSend( CB13, &v1, sizeof(v1) ); } }; bus1.slaveRecv( CB13, &v1, sizeof(v1) ); IBusSlave bus1 behavior B34Snd( IBusSlave bus1 ) { void main(void) { bus1.slaveSend( CB34, 0, 0 ); } }; bus1.slaveSend( CB34, 0, 0 ); IBusSlave bus1 behavior B3( in int v1, IBusSlave bus1 ) { void main(void) {   } }; IBusSlave bus1 bus1.slaveRecv( C2,  );

Lect-06.26CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Protocol Insertion (cont.) B3 B34snd PE2 v1 B13rcv behavior PE2( IBusSlave bus1 ) { int v1; B13Rcv b13rcv( bus1, v1 ); B3 b3 ( v1, bus1 ); B34Snd b34snd( bus1 ); void main(void) { b13rcv.main(); b3.main(); b34snd.main(); } }; IBusSlave bus1 bus

Lect-06.27CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Protocol Insertion (cont.) behavior Design () { DbleHSBus bus1(); PE1 pe1( bus1 ); PE2 pe2( bus1 ); void main(void) { par { pe1.main(); pe2.main(); } } }; DblHSBus bus1; bus1 B2 B1 B13snd B34rcv PE1 v1 B3 B34snd PE2 v1 B13rcv DblHSBus IBusSlave IBusMaster ready ack address[15:0] data[31:0] DblHSProtocol IProtocolSlave IProtocolMaster

Lect-06.28CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Intellectual Property (IP) B3 B34snd PE2 v1 B13rcv IP2 IP Components Functionality of B3 Quality metrics IP component library Pre-designed components Fixed functionality Fixed interface / protocols Allocate IP components Implement functionality through IP reuse

Lect-06.29CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 IP Component Model Component behavior Simulation, synthesis Wrapper Encapsulate fixed IP protocol Provide canonical interface IP2 IIPBus interface IIPBus { void start( int v1,  ); void done( void ); }; 1 5

Lect-06.30CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 B3 B34snd PE2 v1 B13rcv Transducer Insertion B2 B1 B13snd B34rcv PE1 v1 T1 DblHSBus IBusSlaveIBusMaster ready ack address[15:0] data[31:0] IProtocolSlave IProtocolMaster IP2 IIPBus

Lect-06.31CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Transducer Translate between protocols Send / receive messages Buffer in local memory T1 behavior T1( IBusSlave bus, IIPbus ip ) { int v1,  ; void main(void) { bus.slaveReceive( CB13, &v1, sizeof(v1) ); bus.slaveReceive( C2,  ); ip.start( v1,  ); ip.done(); bus.slaveSend( CB34, 0, 0 ); } };

Lect-06.32CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Inlining DblHSBus IBusSlaveIBusMaster ready ack address[15:0] data[31:0] DblHSProtocol IProtocolSlaveIProtocolMaster PE1PE2 PE2Bus IBusSlave PE2Protocol IProtocolSlave PE1Bus IBusMaster PE1Protocol IProtocolMaster PE1 ready ack address[15:0] data[31:0] Create bus interfaces and drivers Refine communication

Lect-06.33CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Inlining ready ack address[15:0] data[31:0] B3 B34snd v1 B13rcv B2 B1 B13snd B34rcv PE1 v1 PE2

Lect-06.34CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Inlining (cont.) channel PE1Protocol( out bit[15:0] addr. inout bit[31:0] data, OSignal ready, ISignal ack ) implements IProtocolMaster { void masterWrite( bit[15:0] a, bit[31:0] d ) {  } void masterRead( bit[15:0] a, bit[31:0] *d ) {  } }; PE1Bus IBusMaster PE1Protocol IProtocolMaster ready ack addr[15:0] data[31:0] channel PE1Bus( out bit[15:0] addr. inout bit[31:0] data, OSignal ready, ISignal ack ) implements IBusMaster { PE1Protocol protocol( addr, data, ready, ack ); void masterSend( int a, void* d, int size ) {  } void masterRecv( int a, void* d, int size ) {  } }; PE1 bus driver Application layer: Protocol layer:

Lect-06.35CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Inlining (cont.) B2 B1 B13snd B34rcv PE1 v1 behavior PE1( out bit[15:0] addr. bit[31:0] data, OSignal ready, ISignal ack ) { PE1Bus bus1( addr, data, ready, ack ); int v1; B1 b1 ( v1 ); B13Snd b13snd( v1, bus1 ); B2 b2 ( v1, bus1 ); B34Rcv b34rcv( bus1 ); void main(void) { b1.main(); b13snd.main(); b2.main(); b34rcv.main(); } }; out bit[15:0] addr, inout bit[31:0] data, OSignal ready, ISignal ack out bit[15:0] addr, inout bit[31:0] data, OSignal ready, ISignal ack PE1Bus bus1( addr, data, ready, ack ); PE1Bus

Lect-06.36CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Inlining (cont.) channel PE2Bus( in bit[15:0] addr. inout bit[31:0] data, ISignal ready, OSignal ack ) implements IBusSlave { PE2BusInterface protocol( addr, data, ready, ack ); void slaveSend( int a, void* d, int size ) {  } void slaveRecv( int a, void* d, int size ) {  } }; PE2Bus IBusSlave PE2Protocol IProtocolSlave ready ack addr[15:0] data[31:0] channel PE2Protocol( in bit[15:0] addr. inout bit[31:0] data, ISignal ready, OSignal ack ) implements IProtocolSlave { void slaveWrite( bit[15:0] a, bit[31:0] d ) {  } void slaveRead( bit[15:0] a, bit[31:0] *d ) {  } }; Application layer: Protocol layer: PE2 bus interface

Lect-06.37CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Inlining (cont.) B3 B34snd v1 B13rcv PE2 behavior PE2( in bit[15:0] addr. bit[31:0] data, ISignal ready, OSignal ack ) { PE2Bus bus1( addr, data, ready, ack ); int v1; B13Rcv b13rcv( bus1, v1 ); B3 b3 ( v1, bus1 ); B34Snd b34snd( bus1 ); void main(void) { b13rcv.main(); b3.main(); b34snd.main(); } }; in bit[15:0] addr, inout bit[31:0] data, ISignal ready, OSignal ack in bit[15:0] addr, inout bit[31:0] data, ISignal ready, OSignal ack PE2Bus bus1( addr, data, ready, ack ); PE2Bus

Lect-06.38CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Model after Inlining (cont.) behavior Design () { // wires bit[15:0] addr; bit[31:0] data; Signal ready; Signal ack; PE1 pe1( addr, data, ready, ack ); PE2 pe2( addr, data, ready, ack ); void main(void) { par { pe1.main(); pe2.main(); } } }; // wires bit[15:0] addr; bit[31:0] data; Signal ready; Signal ack; // wires bit[15:0] addr; bit[31:0] data; Signal ready; Signal ack; addr, data, ready, ack ready ack address[15:0] data[31:0] B3 B34snd v1 B13rcv B2 B1 B13snd B34rcv PE1 v1 PE2 PE2Bus PE1Bus

Lect-06.39CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Communication Model Specification model Architecture model Communication model Implementation model Backend Communication synthesis Architecture exploration Component & bus structure/architecture Top level of hierarchy Bus-functional component models Timing-accurate bus protocols Behavioral component description Timed Estimated component delays

Lect-06.40CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Backend Clock-accurate implementation of PEs Hardware synthesis Software development Interface synthesis Specification model Architecture model Communication model Implementation model Backend Communication synthesis Architecture exploration

Lect-06.41CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Hardware Synthesis Schedule operations into clock cycles Define clock boundaries in leaf behavior C code Create FSMD model from scheduled C code B3 B34snd v1 B13rcv PE2 PE2_CLK Clock boundaries

Lect-06.42CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Scheduled Hardware Model behavior B3( in int v1, IBusSlave bus ) { void main(void) { enum { S0, S1, S2, , S n } state = S0; while( state != S n ) { waitfor( PE2_CLK ); // wait for clock period switch( state ) {  case S i : v1 += v2; // data-path operations if( v1 ) state = S i+1 ; else state = S i+2; break; case S i+1 : // receive message bus.slaveReceive( C2,  ); state = S i+2 ; break; case S i+2 : f3( v1, v2, … ); state = S i+3 ; break;  }} } }; SiSi S i+2 v1 += v2 f3( v1, v2, … ) slaveReceive() Hierarchical FSMD: v1 != 0

Lect-06.43CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Software Synthesis B2 B1 B13snd B34rcv PE1 v1 Ff2 MOVE r0, r1 SHL r3 ADDr2, r3, r4 INC r2 PUSHr1 CALLFf3 POPr0 Implement behavior on processor instruction-set Code generation Compilation

Lect-06.44CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Code Generation B2 B1 B13snd B34rcv PE1 v1 void B1( int *v1 ) {  } void B13Snd( int v1 ) { masterSend( CB13, &v1, sizeof(v1) ); } void B2( int v1 ) {  masterSend( C2, );  } void B34Rcv( void ) { masterReceive( CB34, 0, 0 ); } void main(void) { int v1; B1( &v1 ); B13Snd( v1 ); B2( v1 ); B34Rcv(); } Code Generator

Lect-06.45CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Compilation void b1( int *v1 ) {  } void b13snd( int v1 ) { masterSend( CB13, &v1, sizeof(v1) ); } void b2( int v1 ) {  masterSend( C2, );  } void b34rcv() { masterReceive( CB34, 0, 0 ); } void main(void) { int v1; b1( &v1 ); b13send( v1 ); b2( v1 ); b34rcv(); } OBJ Compiler Target C

Lect-06.46CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Interface Synthesis Implement communication on components Hardware bus interface logic Software bus drivers PE2Bus IBusSlave PE2Protocol IProtocolSlave ready ack addr[15:0] data[31:0] PE1Bus IBusMaster PE1Protocol IProtocolMaster ready ack addr[15:0] data[31:0] S0 S1 S2 S3 S4 DRV

Lect-06.47CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Hardware Interface Synthesis Specification: timing diagram / constraints ready ack address[15:0] data[31:0] (10, 20)(5, 15)  FSMD implementation: clock cycles ready ack address[15:0] data[31:0] 5 CLK S0S1S2S3S4S3State

Lect-06.48CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Hardware Interface FSMD S0S1S2S3S4 !ready && addr != a ready ack = 1 size = size - 1 ack = 0 data = *d d++ size > 0 ready ack address[15:0] data[31:0] 5 CLK S0S1S2S3S4S3State

Lect-06.49CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Hardware Interface FSMD (cont.) channel PE2Bus( in bit[15:0] addr, inout bit[31:0] data, ISignal ready, OSignal ack ) implements IBusSlave { void slaveSend( int a, void* d, int size ) { enum { S0, S1, S2, S3, S4, S5 } state = S0; while( state != S5 ) { waitfor( PE2_CLK ); // wait for clock period switch( state ) { case S0: // sample ready, address if( (ready.val() == 1) && (addr == a) ) state = S1; break; case S1: // read memory, drive data bus data = *( ((long*)d)++ ); state = S2; break; case S2: // raise ack, advance counter ack.set( 1 ); size--; state = S3; break; case S3: // sample ready if( ready.val() == 0 ) state = S4; break; case S4: // reset ack, loop condition ack.set( 0 ); if( size != 0 ) state = S0 else state = S5; }} } void slaveReceive( int a, void* d, int size ) {  } }; S0 S1 S2 S3 S4 !ready && addr != a ready ack = 1 size = size - 1 ack = 0 data = *d d++ size >

Lect-06.50CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Software Interface Synthesis Implement communication over processor bus Map bus wires to processor ports Match with processor ports Map to general I/O ports Generate assembly code Protocol layer: bus protocol timing via processor’s I/O instructions Application layer: synchronization, arbitration, data slicing Interrupt handlers for synchronization

Lect-06.51CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Software Interface Driver FintaHandler PUSH r2 MOVE ack_event,r2 CALL Fevent_notify ; notify ack ev. POP r2 RTI Interrupt handler: FmasterWrite ; protocol layer OUTAr0 ; write addr OUTB r1 ; write data OUTC #0001 ; raise ready MOVE ack_event,r2 CALL Fevent_wait ; wait for ack ev. OUTC #0000 ; lower ready RET FmasterSend ; application layer LOOP L1END,r2 ; loop over data MOVE (r6)+,r1 CALL FmasterWrite ; call protocol L1END RET Bus driver: ready ack address[15:0] data[31:0] PORTA PORTB INTA PORTC µProcessor

Lect-06.52CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Implementation Model Software processorCustom hardware ready ack address[15:0] data[31:0] PE2 PE2_CLKPE1_CLK OBJ PORTA PORTB INTA PORTC PE1 Instruction Set Simulator (ISS) S0 S1 S2 S3 S4

Lect-06.53CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Implementation Model (cont.) #include // ISS API behavior PE1( out bit[15:0] addr, inout bit[31:0] data, OSignal ready, ISignal ack ) { void main(void) { // initialize ISS, load program iss.startup(); iss.load("a.out"); // run simulation for( ; ; ) { // drive inputs iss.porta = addr; iss.portb = data; iss.inta = ack.val(); // run processor cycle iss.exec(); waitfor( PE1_CLK ); // update outputs data = iss.portb; ready.set( iss.portc & 0x01 ); } }; ready ack address[15:0] data[31:0] PE1_CLK OBJ PORTA PORTB INTA PORTC PE1 Instruction Set Simulator (ISS)

Lect-06.54CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Implementation Model (cont.) behavior PE2( in bit[15:0] addr, inout bit[31:0] data, ISignal ready, OSignal ack ) { // Interface FSM PE2Bus bus1( addr, data, ready, ack ); int v1; // memory B13Rcv b13rcv( bus1, v1 ); // FSMDs B3 b3 ( v1, bus1 ); B34Snd b34snd( bus1 ); void main(void) { b13rcv.main(); b3.main(); b34snd.main(); } }; ready ack addr[15:0] data[31:0] PE2 PE2_CLK S0 S1 S2 S3 S

Lect-06.55CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Implementation Model (cont.) behavior Design() { bit[15:0] addr; bit[31:0] data; Signal ready; Signal ack; PE1 pe1( address, data, ready, ack ); PE2 pe2( address, data, ready, ack ); void main(void) { par { pe1.main(); pe2.main(); } } }; ready ack address[15:0] data[31:0] PE2 PE2_CLK PE1_CLK OBJ PORTA PORTB INTA PORTC PE1 Instruction Set Simulator (ISS) S0 S1 S2 S3 S

Lect-06.56CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Implementation Model (cont.) Cycle-accurate system description RTL description of hardware Behavioral/structural FSMD view Object code for processors Instruction-set co-simulation Clocked bus communication Bus interface timing based on PE clock Specification model Architecture model Communication model Implementation model Backend Communication synthesis Architecture exploration

Lect-06.57CprE 588 – Embedded Computer SystemsFeb 17-19, 2009 Summary and Conclusions SpecC system-level design methodology & language Four levels of abstraction Specification model: untimed, functional Architecture model: estimated, structural Communication model: timed, bus-functional Implementation model: cycle-accurate, RTL/IS Specification to RTL System synthesis 1. Architecture exploration (map computation to components) 2. Communication synthesis (map communication to busses) Backend 3. hardware synthesis, software compilation, interface synthesis Well-defined, formal models & transformations Automatic, gradual refinement Executable models, testbench re-use Simple verification