DOC PREVIEW
Columbia COMS W4115 - Easy Hardware Description Language

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

COLUMBIA UNIVERSITY SCHOOL OF ENGINEERING AND APPLIED SCIENCE EHDL Easy Hardware Description Language Language Reference Manual Paolo Mantovani ( pm2613 ) Mashooq Muhaimen ( mm3858 ) Neil Deshpande ( nad2135 ) Kaushik Kaul ( kk2746 ) October 28, 20111 Introduction This manual describes the EHDL language. EHDL is a programming language that allows the programmer to use an imperative style to formally describe and design digital systems. 2 Syntax Notation In the syntax notation used in this manual, nonterminals are indicated by italic type, terminals are indicated by single quotes. We make frequent use of regular expression notation to specify grammar patterns. r* means the pattern r may appear zero or more time, r+ means the r may appear one or more times, r? means r may appear zero or once. r1 | r2 denotes an option between two patterns, r1 r2 denotes r1 followed by r2. 3 Lexical Conventions A program is a list of global constants and a list of functions. A function is a list of output buses, input buses and a body that describes the functionality of a portion of the hardware design that that function represents. 3.1 Tokens There are 7 types of tokens: white space, comments, identifiers, keywords, literals, operators, and other separators. If the input string stream has been separated into tokens up to a given character, the next token is the longest string of characters that could constitute a token. 3.2 Whitespace Blanks, tabs, and newlines, collectively referred to as “white space” are ignored except to separate tokens. 3.3 Comments There are two types of comments: single line and multiline. The characters // introduce a single line comment. The characters /* introduce a multiline comment, which terminate with the characters */. // has no special meaning inside a /* ... */ block, and /* and */ lose their meaning if they come after // in a line. 3.4 Identifiers An identifier consists of a letter followed by other letters and digits. The letters are the ascii characters a-z, A-Z and _. Digits are ascii characters 0-9. Upper and lower case characters are different (EhDl and ehdl are separate identifiers). There is no limit on the length of an identifier. letter → ['a'-''z' 'A'-'Z' '_'] digit → ['0'-''9'] identifier → letter(letter | digit)+3.5 Keywords The following identifiers are reserved as keywords and may not be used otherwise: if Switch int POS else case while ASYNC for const uint return 3.6 Literals A literal is a sequence of digits optionally preceded by the character '-' to indicate negativity. Some examples of literals are : 123, -123 , 0 etc. literal → -? digit+ 3.7 Operators EHDL has the following operators : + - * / % < > <= >= != == || && ^ << >> ^ = ( ) [ ] ! The precedence and associativity of the operators are described in section 5.3. 3.8 Separators EHDL has the following separators and delimiters: , : ; { } 4 Meaning of Identifiers Identifiers refer to a variety of things: functions, constants, and variables. A variable is defined solely by its type. 4.1 Types There are two fundamental types: int(k) type and uint(k) type. There is also a derived type : the array type. 4.1.1 int(k) and uint(k) Type type_specifier → int(k) | uint(k) int(k) and uint(k) are used to indicate a k bit input or output bus. k has to be greater than 0. The value an int(k) bus takes is interpreted to be a signed integer, while uint(k) bus values are interpreted tobe unsigned. Examples of int(k), uint(k) types are: int(5), uint(32) etc. 4.1.2 Array Type Arrays are vectors containing a particular type. e.g. uint(32) imem[512] is a 512 length vector of uint(32) types. 4.2 Functions An EHDL function represents a portion of hardware design that has well defined inputs and outputs and that performs a well-defined function. [3] 5 Expressions Expressions are constants, variables, operator expressions and function calls. expr → constants | variables | ops | function_call 5.1 Constants A constant is a literal or a const type declared in accordance to section 6. 5.2 Variables A variable has the following form: variable → identifier | array-reference | subbus 5.2.1 Array References array-reference → identifier[expr] The first identifier must be an array type while the expr inside the square brackets must evaluate to a uint(k) type (a bus interpreted as its value, which is a positive integer) or a number (for instance the index of a for-statement). If an array reference is made inside the body of a for loop, and if the expr inside the square brackets includes a loop index, the expression must be a const expression. 5.2.2 Subbus subbus → identifier(const:const) Subbuses can be used to refer to a subset of bits that form a named bus. e.g. if m is an uint(32) input bus, m(0:4) denotes the first 5 bits of m.5.3 Operator Expressions Table 1 lists the operators in order of precedence (highest to lowest). Their associativity indicates in what order operators of equal precedence are applied. Operator Description Associativity ( ) [ ] . Parentheses. Used for grouping, also function calls Brackets (array subscript) Member selection via structure name left to right ! Logical Negation right to left * / % Mult/div/modulus left to right + - Plus/minus left to right << >> Bitwise shift left/ bitwise shift right left to right < <= > >= less than/less than equal to/greater than/greater than equal to left to right == != is equal to/is not equal to left to right && || ^ logical and/logical or/xor left to right : = array index range/ assignment left to right , Comma (separate expressions) left to right Table 1. Operator precedence and associativity 5.4 Function Calls An EHDL function call has the following syntax: function_call → identifier( arglist? ) arglist is a comma separated list of expressions. Examples: gcd(), gcd(a,b) gcd(a , b*c) etc. 6 Declarations An EHDL declaration is a const declaration, int declaration, array declaration or a function declaration. declaration → const-declaration | ASYNC? int-declaration | array-declaration | function-declaration6.1 const Declaration A const declaration


View Full Document

Columbia COMS W4115 - Easy Hardware Description Language

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Download Easy Hardware Description Language
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Easy Hardware Description Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Easy Hardware Description Language 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?