Ephemeral Project • Project Tasks • Ephemeral • Unix/Linux C++ implementation • MPP implementation • Other ?
Dec 21, 2015
Ephemeral Project
• Project Tasks• Ephemeral• Unix/Linux C++
implementation• MPP implementation• Other
?
Project Tasks
• Compiler 1– Lexer/Parser– Machine independent
Semantic Analysis– Linux implementation
• MPP Instruction Set• Simulator• MPP sem. analysis• MPP code generation
Ephemeral language
• Features:– Values:
• integers (bit[..])– Booleans are 1-bit integers– Char’s are 8-bit integers
• Code• Port references
– No block nesting– Abstraction and types:
• Place – Ephemeral location has formal parameters
• Code – holds code• Action – like a function• Port – transport between places• Bit[] – integers
– Multi-line nested comments
– Imperatives:• Send message• Place creation/designation• Low-level Control
– Send code in messages– branching= send
conditionally selected code
– Expressions:• Arithmetic
– Usual C operator set including conditional ?:
– Binary (not hex) literals– Decimal literals
• Code– Action name or formal– conditional
• Port reference– Place name.port or formal– conditional
Compiler design
• Flex lexer
• Bison parser
• custom semantics checks
• Intermediate representation
• Generate C++ code for Linux implementation
• Generate Message code for MPP
do anything
cannot
powerpoint
Machine independent semantic analysis
• Check that all referenced names are defined
• Check that actual parameters types match formal
• Check duplication of port references (ports and places are single-use)
Intermediate representation
• Syntax tree• Action table• Code table
– Message table
• Place table– Message table
• Syntax tree augmented with types &c.
Unix/Linux C++ implementation features
• Compilation by translation to C++
• Unlimited places & place “creation”
• C++: classname var;• Ephemeral:
– placename var();
– placename var(time);
• Built-in places for I/O• Complex expressions• Unlimited messages
&c.
Unix/Linux C++ implementation
• Gen C++ code• Ready place queue• Waiting place
collection• function pointers• Error checking for
MPP
C++ code generation• Place pn {
– Go:( w theworkf, bit[1] x, pn.Go p);
– Go;• };• Action work(pn) {
– pn nextnext;– p:( theworkf, x+1,
nextnext.Go );• };• Code w { work; };• // abstraction only
• struct pn:public place {– Struct { code theworkf, int x,
port p} Go;
• };• function work(pn &here){
– pn & nextnext = *new pn;– Here.Go.p->Go+=1;// special– Here.Go.p->Go .theworkf =
here.Go.theworkf;– Here.Go.p->Go.x =
here.Go.x+1;– Here.Go.p->Go.p = &nextnext;
• };
MPP implementation
• Instruction set design• simulator• Space-time• Compilation
considerations• locality
P P
P P
P
MPP implementation features
• True Compilation
• no place “creation”
• Place “allocation” in relative space-time
• C++: int * var = (int*)0x88446;
• Use “(*var)” in code.
• Ephemeral:– placename var( time_offset,
location_offset );
• I/O ?• limited expressions• limited messages per
place
MPP application
• Vibrating string simulation
• Use fixed finite elements
• Relatively simple coding.
• Ideal application• Application topology
exactly matches pipeline topology
MPP Instruction set design
• Simplified architecture• 2 space-time
dimensions• X,Y diagonal in space-
time• 2 inputs and 2 outputs
per “place”
X-1,Y
X,Y+1
X+1,Y
X,Y-1
X,Y
MPP Instruction set design
• Message format:• “active” bit• 128 bit message data
– Up to 8 fields
• Field descriptor block– Defines up to 8 fields
– Analyzed and generated automatically by proc.
Message
Active? Field sizes “data” fields
MPP Instruction set design
• (35 bit) Instruction• Permutation(16)• Operation
– Opcode(5)
– arg1(4)
– arg2(4)
– arg3(4)
• Active message bits(2)
instruction
permutation operation Messages active?
X+1,Y active? X,Y+1 active?opcodeArgument field
numbers4parts
MPP Opcodes
• (5 bit) Opcode• Usual C int operator
support and conditional swap for
• “?:” conditional operator
• | ^ & < <= == >= > != + - * / % >> << - ~ !
MPP Instruction set design
• Permutation(16 bits)• Re-arrange any four
contiguous segments of the messages
• Example:– 5,1,7,0 produces this ->
– permutation
0,1 5, 7
5, 1, 7, 0
MPP simulator
• Simulate an “array” of processors.
• These processors have no “state”. The system state is entirely in the messages.
• main data structure:
• Array of messages
• Simple simulation loops with possible optimization for locality
MPP instruction code generation• Place pn {
– Left:( w workcode,• Bit[ 8 ] x,• Bit[ 8 ] one,• );• Left;
• };• Action work(pn) {
– pn next(0,1);– Next.left:( workcode,
x+one, one );• };• Code w { work; };
• Fields: 35,8,8 • Active message: left• Permutation: 0,0,0,0• Opcode: +• Args, 1,2,1