Last Time. Introduction to Design Languages. Syntax, Semantics, and Model. This Time. Syntax. Computational Model. Introduction to the class

Similar documents
Languages for Embedded System Design

What are Embedded Systems?

A Simple Example. The Synchronous Language Esterel. A First Try: An FSM. The Esterel Version. The Esterel Version. The Esterel Version

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

Introduction to Embedded Systems

Synthesizable Verilog

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

CS232 VHDL Lecture. Types

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

A Deterministic Concurrent Language for Embedded Systems

Hardware Modeling using Verilog Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Quick Introduction to SystemVerilog: Sequental Logic

Verilog Execution Semantics

ECE 551: Digital System *

A PRIMITIVE EXECUTION MODEL FOR HETEROGENEOUS MODELING

Writing Circuit Descriptions 8

A Finer Functional Fibonacci on a Fast fpga

Embedded System Design and Modeling EE382V, Fall 2008

A Deterministic Concurrent Language for Embedded Systems

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements

Lexical Analysis. COMP 524, Spring 2014 Bryan Ward

Verifying Concurrent ML programs

A Deterministic Concurrent Language for Embedded Systems

The Esterel Language. The Esterel Version. Basic Ideas of Esterel

This book is licensed under a Creative Commons Attribution 3.0 License

EE178 Lecture Verilog FSM Examples. Eric Crabill SJSU / Xilinx Fall 2007

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

Week 4 Tutorial: Verilog Primer Part 2. By Steve Engels

1 Parsing (25 pts, 5 each)

Nonblocking Assignments in Verilog Synthesis; Coding Styles That Kill!

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

6.001 Notes: Section 8.1

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

An Overview of the DE Hardware Description Language and Its Application in Formal Verification of the FM9001 Microprocessor

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

Programming Languages Third Edition

Defining Languages GMU

A language is a subset of the set of all strings over some alphabet. string: a sequence of symbols alphabet: a set of symbols

Syntax. In Text: Chapter 3

Specifications and Modeling

Specifications Part 1

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

SystemC 1.3. Languages for Embedded Systems. Prof. Stephen A. Edwards Summer 2004 NCTU, Taiwan

VERILOG: FLIP-FLOPS AND REGISTERS

Chapter 3. Describing Syntax and Semantics

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

Digital Design with FPGAs. By Neeraj Kulkarni

Inheritance and Substitution (Budd chapter 8, 10)

CONVENTIONAL EXECUTABLE SEMANTICS. Grigore Rosu CS522 Programming Language Semantics

SML Style Guide. Last Revised: 31st August 2011

Introduction to Computing and Systems Architecture

1 Design Process HOME CONTENTS INDEX. For further assistance, or call your local support center

Subject: Scheduling Region Questions and Problems of new SystemVerilog commands

Compiling Parallel Algorithms to Memory Systems

Section 8. The Basic Step Algorithm

Dataflow Languages. Languages for Embedded Systems. Prof. Stephen A. Edwards. March Columbia University

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

Compiler Design. Subject Code: 6CS63/06IS662. Part A UNIT 1. Chapter Introduction. 1.1 Language Processors

L2: Design Representations

Compilers. Prerequisites

Paradigms of computer programming

UNIT I Programming Language Syntax and semantics. Kainjan Sanghavi

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

Parsing. source code. while (k<=n) {sum = sum+k; k=k+1;}

Theory and Compiling COMP360

Semantic Analysis. Lecture 9. February 7, 2018

5.7. Microprogramming: Simplifying Control Design 5.7

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

QUIZ. Source:

Distributed Systems Programming (F21DS1) Formal Verification

Application: Programming Language Semantics

Lecture 2 Finite Automata

Concurrent Models of Computation

(Refer Slide Time: 1:27)

fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik /11/15

EE 231 Fall EE 231 Homework 8 Due October 20, 2010

Ordering Within Expressions. Control Flow. Side-effects. Side-effects. Order of Evaluation. Misbehaving Floating-Point Numbers.

PDHonline Course G349. State Machines. Mark A. Strain, P.E. PDH Online PDH Center

CONVENTIONAL EXECUTABLE SEMANTICS. Grigore Rosu CS422 Programming Language Semantics

Control Flow COMS W4115. Prof. Stephen A. Edwards Fall 2006 Columbia University Department of Computer Science

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Chapter 7. - FORTRAN I control statements were based directly on IBM 704 hardware

Memory Supplement for Section 3.6 of the textbook

Synthesis of Combinational and Sequential Circuits with Verilog

Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog

Specifications and Modeling

Verilog 1 - Fundamentals

Introduction to Lexing and Parsing

Sequential Logic Design

Digital VLSI Design with Verilog

CS415 Compilers Overview of the Course. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

Threads and Continuations COS 320, David Walker

Ch 9: Control flow. Sequencers. Jumps. Jumps

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

Syntax and Parsing COMS W4115. Prof. Stephen A. Edwards Fall 2003 Columbia University Department of Computer Science

Verilog HDL. Testing & Verification Dept. of Computer Science & Engg,, IIT Kharagpur

Transcription:

Introduction to Design Languages Prof. Stephen A. Edwards Last Time Introduction to the class Embedded systems Role of languages: shape solutions Project proposals due September 26 Do you know what you re doing? Lobby, Paris Opera House This Time General ideas behind languages Syntax, Semantics, and Models of Computation Specification versus Modeling Concurrency: Two things at once Nondeterminsm: Unpredictability Types of communication: Memory, broadcasting Hierarchy Syntax, Semantics, and Model Marionette model You control the syntax The semantics connect the syntax to the model You ultimately affect a model Syntax Formally: Language: infinite set of strings from an alphabet Alphabet DNA {A T G C} Student Transcripts {w1007-02 w1009-01 w4559-02 } English {aardvark abacus abalone } Verilog {always module } Rosetta stone Computational Model What a string ultimately affects Does not need to be unique Babbage s Difference Engine Model DNA Proteins suspended in water Student Transcripts Your knowledge The admiration of others English Natural language understanding Verilog Discrete event simulator Netlist of gates and flip-flops 1

Semantics How to interpret strings in the model Also not necessarily unique Semantics DNA [[ AGA ]] = Arginine [[ TAG ]] = STOP Student Transcripts [[ w1007-02 ]] = Java English [[ Look out! ]] = I m in danger Verilog [[ always @posedge clk]] = FF When I use a word, it means just what I choose it to mean - neither more nor less. Defining Syntax Generally done with a grammar Recursively-defined rules for constructing valid sentences Backus-Naur Form expr :: literal expr + expr expr * expr Not a focus of this class Defining Semantics Operational Semantics Abstract machine (memory, program counter) Each statement advance machine state Closest to implementation Specification and Modeling How do you want to use the program? Specification languages say build this, please Denotational Semantics Context domain (memory state) Answer domain (result, I/O behavior) Meaning function: Program (Context Answer) Much more mathematical Able to deal with recursion and self-reference Modeling languages allow you to describe something that does or will exist Distinction a function of the model and the language s semantics Copernican Model of the Solar System Specification Versus Modeling C is a specification language Semantics very operational Clear how the language is to be translated into assembly language Verilog is a modeling language Semantics suggestive of a simulation procedure Good for building a model that captures digital hardware behavior (delays, race conditions, unknown values) Not as good for specification: how do you build something with a specific delay? Gratuitous Picture Chartres Cathedral, France Façade a renovation of and earlier Romanesque church (note rounded windows) Right tower considered the architectural gem Starts complicated Ends simple, to-the-point 2

Concurrency Why bother? Harder model to program Real world is concurrent Good controller architecture: concurrently-running process controlling each independent system component E.g., process for right brake, process for left brake, process for brake pedal The Challenge of Concurrency Synchronization How to arbitrate access to shared resources Memory I/O ports Actuators Different approaches to concurrency a focus of the course Approaches to Concurrency Shared memory / Every man for himself Adopted by Java, other software languages Everything s shared, nothing synchronized by default Synchronization through locks/monitors/semaphores Most flexible Easy to get wrong Synchronous Global clock regulates passage of time Very robust in the presence of timing uncertainty Proven very successful for hardware design Synchronization overhead often onerous Communication and Concurrency Idea: let processes run asynchronously and only force them to synchronize when they communicate CAR Hoare s Communicating Sequential Processes Rendezvous-style communication: Processes that wish to communicate both wait until the other is ready to send/receive Kahn Process Networks (later in the course) Communicate through channels Writer always continues Reader waits until data has arrived Nondeterminism Nondeterministic Is Not Random Does a program mean exactly one thing? Deterministic: 1+1 = 2 always Example from C: Increment a, return result Random: 1+1 = 2 50% of the time, 3 otherwise printf( %d %d %d, ++a, ++a, ++a); Nondeterministic: 1+1 = 2 or 3, but I m not telling Argument evaluation order is undefined Program behavior subject to compiler interpretation Are you sure your program does what you think? The nondeterministic behavior could look determinstic, random, or something worse 3

Nondeterminism Is Awful Much harder to be sure your specification or model is correct True nondeterminstic language difficult to simulate Should produce any of these results Must maintain all possible outcomes, which grows exponentially Example From Verilog Concurrent procedure execution order undefined always @(posedge clk) $write( a ) always @(posedge clk) $write( b ) First implementation moved procedures between two push-down stacks. Result: Idiosyncrasies of a particular implementation of a nondeterministic language often become the de facto standard a b b a a b b a a b b a Later simulators had to match now-expected behavior Nondeterminism Is Great True nondeterministic specification often exponentially smaller than deterministic counterpart Implicit all possible states representation E.g., nondeterministic finite automata for matching regular expressions If system itself is truly nondeterministic, shouldn t its model also be? Can be used to expose design errors More flexible: only there if you want to use it Communication Memory Value written to location Value stays until written again Value can be read zero or more times after write No synchronization Buffer Value written to buffer Value held until read Values read back in order they were written Correctness remains more elusive Communication Wires May or may not have explicit write operation Value immediately seen by all readers More like a system of equations than a sequence of operations Hierarchy Most languages have ability to create pieces and assemble them Advantage: Information hiding User does not know details of a piece Easier to change implementation of piece without breaking whole system Easier to get small piece right Facilitates abstraction: easier to understand the whole Advantage: Reuse Pieces less application-specific; can be used elsewhere 4

Summary Languages have syntax, semantics, and model Syntax usually defined with grammar Semantics can be defined operationally or denotationally Many possible models: A focus of this class Summary Concurrency useful for handling real world Synchronization big challenge Shared memory and locks Synchrony Rendezvous synchronization Buffer synchronization You ask for something with a specification language You describe something that does or will exist with a modeling language Nondeterminism Good for certain models Can be very succinct Makes specification hard Makes verification harder Summary Communication techniques Memory Buffered Wired Hierarchy for information hiding 5