pydgin:(genera-ng(fast(instruc-on(set(simulators( from...
TRANSCRIPT
Cornell'University'Computer'Systems'Laboratory'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(
from(Simple(Architecture(Descrip-ons((
with(Meta?Tracing(JIT(Compilers(
Derek'Lockhart,'Berkin'Ilbeyi,'and'Christopher'Ba=en'
Motivation(
'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 1(/(20(
Instruc>on?Set'Simulator'
Instruc>on'set'simulators'perform'func-onal(simula>on'of'a'target'architecture.'
armv5_binary'
Motivation(
'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 1(/(20(
armv5_binary'
Instruc>on'set'simulators'perform'func-onal(simula>on'of'a'target'architecture.'
Instruc>on?Set'Simulator'
SoEware'Development'
Hardware'Design'
Motivation(
'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 1(/(20(
Instruc>on?Set'Simulator'
SoEware'Development'
Hardware'Design'
Instruc>on'set'simulators'perform'func-onal(simula>on'of'a'target'architecture.''Instruc>on?Set'Simulator'Goals:''• Accuracy'• Observability'• Performance''
Motivation(
'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 1(/(20(
Instruc>on'set'simulators'perform'func-onal(simula>on'of'a'target'architecture.''Instruc>on?Set'Simulator'Goals:''• Accuracy'• Observability'• Performance'• Produc>vity''
Instruc>on?Set'Simulator'
SoEware'Development'
Hardware'Design'
Motivation(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 1(/(20(
SoEware'Development'
Hardware'Design'
Instruc>on?Set'Simulator'
Hardware'Design'
' Instruc>on'set'simulators'perform'func-onal(simula>on'of'a'target'architecture.''Instruc>on?Set'Simulator'Goals:''• Accuracy'• Observability'• Performance'• Produc>vity''
Motivation(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 1(/(20(
SoEware'Development'
ISA'
Hardware'Design'Hardware'Design'
Instruc>on'set'simulators'perform'func-onal(simula>on'of'a'target'architecture.''Instruc>on?Set'Simulator'Goals:''• Accuracy'• Observability'• Performance'• Produc>vity''
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 2(/(20(
Performance'Produc>vity'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 2(/(20(
Performance'Produc>vity'
Architectural'Descrip>on'Language'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 2(/(20(
Performance'Produc>vity'
Architectural'Descrip>on'Language'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 2(/(20(
Performance'Produc>vity'
Architectural'Descrip>on'Language'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
[SimIt?ARM2006]'[Wagstaff2013]'
[Simit?ARM2006]'''J.D’Errico'and'W.Qin.'Construc>ng'Portable'Compiled'Instruc>on?Set'Simulators'—'An'ADL?Driven'Approach.'DATE’06.'[Wagstaff2013]''''''H.'Wagstaff,'M.'Gould,'B.'Franke,'and'N.Topham.'Early'Par>al'Evalua>on'in'a'JIT?Compiled,'Retargetable'Instruc>on''
' ''''''''Set'Simulator'Generated'from'a'High?Level'Architecture'Descrip>on.''DAC’13.'''
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 2(/(20(
Performance'Produc>vity'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
[SimIt?ARM2006]'[Wagstaff2013]'
[Simit?ARM2006]((+'Page?based'JIT'?'Ad?hoc'ADL'with'custom'parser'?'Unmaintained'
[Wagstaff2013]((+'Region?based'JIT'+'Industry?supported'ADL'(ArchC)'?'C++?based'ADL'is'verbose'?'Not'Public'
Architectural'Descrip>on'Language'
[Simit?ARM2006]'''J.D’Errico'and'W.Qin.'Construc>ng'Portable'Compiled'Instruc>on?Set'Simulators'—'An'ADL?Driven'Approach.'DATE’06.'[Wagstaff2013]''''''H.'Wagstaff,'M.'Gould,'B.'Franke,'and'N.Topham.'Early'Par>al'Evalua>on'in'a'JIT?Compiled,'Retargetable'Instruc>on''
' ''''''''Set'Simulator'Generated'from'a'High?Level'Architecture'Descrip>on.''DAC’13.'''
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 3(/(20(
Performance'Produc>vity'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Dynamic'Language'Interpreter'in'C'with'JIT'Compiler'
[SimIt?ARM2006]'[Wagstaff2013]'
Architectural'Descrip>on'Language'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 3(/(20(
Performance'Produc>vity'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Dynamic'Language'Interpreter'in'C'with'JIT'Compiler'
[SimIt?ARM2006]'[Wagstaff2013]'
Architectural'Descrip>on'Language'
Key(Insight:((
Similar'produc>vity?performance'challenges'for'building'high?performance'interpreters'of'
dynamic'languages.'(e.g.'JavaScript,'Python)(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 3(/(20(
Performance'Produc>vity'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Dynamic'Language'Interpreter'in'C'with'JIT'Compiler'
[SimIt?ARM2006]'[Wagstaff2013]'
Architectural'Descrip>on'Language'
Key(Insight:((
Similar'produc>vity?performance'challenges'for'building'high?performance'interpreters'of'
dynamic'languages.'(e.g.'JavaScript,'Python)(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 3(/(20(
Performance'Produc>vity'
RPython'Transla>on'Toolchain'
[SimIt?ARM2006]'[Wagstaff2013]'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Dynamic?Language'Interpreter'in'RPython'
Dynamic'Language'Interpreter'in'C'with'JIT'Compiler'
Architectural'Descrip>on'Language'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 3(/(20(
Performance'Produc>vity'
RPython'Transla>on'Toolchain'
[SimIt?ARM2006]'[Wagstaff2013]'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Dynamic?Language'Interpreter'in'RPython'
Dynamic'Language'Interpreter'in'C'with'JIT'Compiler'
Architectural'Descrip>on'Language'
Meta?Tracing(JIT:(makes(JIT(genera-on(generic(across(languages((
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 4(/(20(
Performance'Produc>vity'
RPython'Transla>on'Toolchain'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Architectural'Descrip>on'Language'
Pydgin
RPython'Transla>on'Toolchain'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 4(/(20(
Performance'Produc>vity'
Instruc>on'Set'Interpreter'in'C'
with'DBT'
Architectural'Descrip>on'Language'
Pydgin
• Flexible,'produc>ve,'pseudocode?like'ADL'syntax'• ADL'embedded'in'a'popular,'general?purpose'language'• Tracing?JIT'generator'applies'across'many'different'ISAs'• Leverages'advancements'from'dynamic?language'JIT'research''
Pydgin(Framework(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 5(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(Framework(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 6(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(ADL:(ARMv5(Architectural(State(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 6(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!class!State(!object!):!!!!!!!!!def!__init__(!self,!memory,!reset_addr=0x400!):!!!!!!!!!self.pc!!=!reset_addr!!!!!!!!!self.rf!!=!ArmRegisterFile(!self,!num_regs=16!)!!!!!!!!!self.mem!=!memory!!!!!!!!!!!self.rf[!15!]!=!reset_addr!!!!!!!!!!!#!current!program!status!register!(CPSR)!!!!!!!!!self.N!!!!=!0b0!!!!!!#!Negative!condition!!!!!!!!!self.Z!!!!=!0b0!!!!!!#!Zero!condition!!!!!!!!!self.C!!!!=!0b0!!!!!!#!Carry!condition!!!!!!!!!self.V!!!!=!0b0!!!!!!#!Overflow!condition!!!!!!!!!def!fetch_pc(!self!):!!!!!!!!!return!self.pc'
Pydgin(ADL:(ARMv5(Architectural(State(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 6(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!class!State(!object!):!!!!!!!!!def!__init__(!self,!memory,!reset_addr=0x400!):!!!!!!!!!self.pc!!=!reset_addr!!!!!!!!!self.rf!!=!ArmRegisterFile(!self,!num_regs=16!)!!!!!!!!!self.mem!=!memory!!!!!!!!!!!self.rf[!15!]!=!reset_addr!!!!!!!!!!!#!current!program!status!register!(CPSR)!!!!!!!!!self.N!!!!=!0b0!!!!!!#!Negative!condition!!!!!!!!!self.Z!!!!=!0b0!!!!!!#!Zero!condition!!!!!!!!!self.C!!!!=!0b0!!!!!!#!Carry!condition!!!!!!!!!self.V!!!!=!0b0!!!!!!#!Overflow!condition!!!!!!!!!def!fetch_pc(!self!):!!!!!!!!!return!self.pc'
Pydgin(ADL:(ARMv5(Architectural(State(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 6(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!class!State(!object!):!!!!!!!!!def!__init__(!self,!memory,!reset_addr=0x400!):!!!!!!!!!self.pc!!=!reset_addr!!!!!!!!!self.rf!!=!ArmRegisterFile(!self,!num_regs=16!)!!!!!!!!!self.mem!=!memory!!!!!!!!!!!self.rf[!15!]!=!reset_addr!!!!!!!!!!!#!current!program!status!register!(CPSR)!!!!!!!!!self.N!!!!=!0b0!!!!!!#!Negative!condition!!!!!!!!!self.Z!!!!=!0b0!!!!!!#!Zero!condition!!!!!!!!!self.C!!!!=!0b0!!!!!!#!Carry!condition!!!!!!!!!self.V!!!!=!0b0!!!!!!#!Overflow!condition!!!!!!!!!def!fetch_pc(!self!):!!!!!!!!!return!self.pc'
Pydgin(ADL:(ARMv5(Architectural(State(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 6(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!class!State(!object!):!!!!!!!!!def!__init__(!self,!memory,!reset_addr=0x400!):!!!!!!!!!self.pc!!=!reset_addr!!!!!!!!!self.rf!!=!ArmRegisterFile(!self,!num_regs=16!)!!!!!!!!!self.mem!=!memory!!!!!!!!!!!self.rf[!15!]!=!reset_addr!!!!!!!!!!!#!current!program!status!register!(CPSR)!!!!!!!!!self.N!!!!=!0b0!!!!!!#!Negative!condition!!!!!!!!!self.Z!!!!=!0b0!!!!!!#!Zero!condition!!!!!!!!!self.C!!!!=!0b0!!!!!!#!Carry!condition!!!!!!!!!self.V!!!!=!0b0!!!!!!#!Overflow!condition!!!!!!!!!def!fetch_pc(!self!):!!!!!!!!!return!self.pc'
Pydgin(ADL:(ARMv5(Encodings(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 7(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
encodings!=![!!!!['nop',!!!'00000000000000000000000000000000'],!!!['mul',!!!'xxxx0000000xxxxxxxxxxxxx1001xxxx'],!!!['umull',!'xxxx0000100xxxxxxxxxxxxx1001xxxx'],!!!['adc',!!!'xxxx00x0101xxxxxxxxxxxxxxxxxxxxx'],!!!!['and',!!!'xxxx00x0000xxxxxxxxxxxxxxxxxxxxx'],!!!['b',!!!!!'xxxx1010xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bl',!!!!'xxxx1011xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bic',!!!'xxxx00x1110xxxxxxxxxxxxxxxxxxxxx'],!!!['bkpt',!!'111000010010xxxxxxxxxxxx0111xxxx'],!!!!#!...!!!!['teq',!!!'xxxx00x10011xxxxxxxxxxxxxxxxxxxx'],!!!['tst',!!!'xxxx00x10001xxxxxxxxxxxxxxxxxxxx'],!!]'
Pydgin(ADL:(ARMv5(Encodings(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 7(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
encodings!=![!!!!['nop',!!!'00000000000000000000000000000000'],!!!['mul',!!!'xxxx0000000xxxxxxxxxxxxx1001xxxx'],!!!['umull',!'xxxx0000100xxxxxxxxxxxxx1001xxxx'],!!!['adc',!!!'xxxx00x0101xxxxxxxxxxxxxxxxxxxxx'],!!!!['and',!!!'xxxx00x0000xxxxxxxxxxxxxxxxxxxxx'],!!!['b',!!!!!'xxxx1010xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bl',!!!!'xxxx1011xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bic',!!!'xxxx00x1110xxxxxxxxxxxxxxxxxxxxx'],!!!['bkpt',!!'111000010010xxxxxxxxxxxx0111xxxx'],!!!!#!...!!!!['teq',!!!'xxxx00x10011xxxxxxxxxxxxxxxxxxxx'],!!!['tst',!!!'xxxx00x10001xxxxxxxxxxxxxxxxxxxx'],!!]'
Pydgin(ADL:(ARMv5(Encodings(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 7(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
encodings!=![!!!!['nop',!!!'00000000000000000000000000000000'],!!!['mul',!!!'xxxx0000000xxxxxxxxxxxxx1001xxxx'],!!!['umull',!'xxxx0000100xxxxxxxxxxxxx1001xxxx'],!!!['adc',!!!'xxxx00x0101xxxxxxxxxxxxxxxxxxxxx'],!!!!['and',!!!'xxxx00x0000xxxxxxxxxxxxxxxxxxxxx'],!!!['b',!!!!!'xxxx1010xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bl',!!!!'xxxx1011xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bic',!!!'xxxx00x1110xxxxxxxxxxxxxxxxxxxxx'],!!!['bkpt',!!'111000010010xxxxxxxxxxxx0111xxxx'],!!!!#!...!!!!['teq',!!!'xxxx00x10011xxxxxxxxxxxxxxxxxxxx'],!!!['tst',!!!'xxxx00x10001xxxxxxxxxxxxxxxxxxxx'],!!]'
Pydgin(ADL:(ARMv5(Encodings(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 7(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
encodings!=![!!!!['nop',!!!'00000000000000000000000000000000'],!!!['mul',!!!'xxxx0000000xxxxxxxxxxxxx1001xxxx'],!!!['umull',!'xxxx0000100xxxxxxxxxxxxx1001xxxx'],!!!['adc',!!!'xxxx00x0101xxxxxxxxxxxxxxxxxxxxx'],!!!['add',!!!'xxxx00x0100xxxxxxxxxxxxxxxxxxxxx'],!!!['and',!!!'xxxx00x0000xxxxxxxxxxxxxxxxxxxxx'],!!!['b',!!!!!'xxxx1010xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bl',!!!!'xxxx1011xxxxxxxxxxxxxxxxxxxxxxxx'],!!!['bic',!!!'xxxx00x1110xxxxxxxxxxxxxxxxxxxxx'],!!!['bkpt',!!'111000010010xxxxxxxxxxxx0111xxxx'],!!!!#!...!!!!['teq',!!!'xxxx00x10011xxxxxxxxxxxxxxxxxxxx'],!!!['tst',!!!'xxxx00x10001xxxxxxxxxxxxxxxxxxxx'],!!]'
Pydgin(ADL:(ARMv5(Instruction(Semantics(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 8(/(20(
def!execute_add(!s,!inst!):!!!!!if!condition_passed(!s,!inst.cond()!):!!!!!a,!!!=!s.rf[!inst.rn()!]!!!!!b,!_!=!shifter_operand(!s,!inst!)!!!!!result!=!a!+!b!!!!!s.rf[!inst.rd()!]!=!trim_32(result)!!!!!!!if!inst.S():!!!!!!!#!...!!!!!!!s.N!=!(result!>>!31)&1!!!!!!!s.Z!=!trim_32(result)!==!0!!!!!!!s.C!=!carry_from(result)!!!!!!!s.V!=!overflow_from(a,!b,!result)!!!!!!!if!inst.rd()!==!15:!!!!!!!return!!!s.rf[PC]!=!s.fetch_pc()!+!4'
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(ADL:(ARMv5(Instruction(Semantics(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 8(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
def!execute_add(!s,!inst!):!!!!!if!condition_passed(!s,!inst.cond()!):!!!!!a,!!!=!s.rf[!inst.rn()!]!!!!!b,!_!=!shifter_operand(!s,!inst!)!!!!!result!=!a!+!b!!!!!s.rf[!inst.rd()!]!=!trim_32(result)!!!!!!!if!inst.S():!!!!!!!#!...!!!!!!!s.N!=!(result!>>!31)&1!!!!!!!s.Z!=!trim_32(result)!==!0!!!!!!!s.C!=!carry_from(result)!!!!!!!s.V!=!overflow_from(a,!b,!result)!!!!!!!if!inst.rd()!==!15:!!!!!!!return!!!s.rf[PC]!=!s.fetch_pc()!+!4'
Pydgin(ADL:(ARMv5(Instruction(Semantics(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 8(/(20(
def!execute_add(!s,!inst!):!!!!!if!condition_passed(!s,!inst.cond()!):!!!!!a,!!!=!s.rf[!inst.rn()!]!!!!!b,!_!=!shifter_operand(!s,!inst!)!!!!!result!=!a!+!b!!!!!s.rf[!inst.rd()!]!=!trim_32(result)!!!!!!!if!inst.S():!!!!!!!#!...!!!!!!!s.N!=!(result!>>!31)&1!!!!!!!s.Z!=!trim_32(result)!==!0!!!!!!!s.C!=!carry_from(result)!!!!!!!s.V!=!overflow_from(a,!b,!result)!!!!!!!if!inst.rd()!==!15:!!!!!!!return!!!s.rf[PC]!=!s.fetch_pc()!+!4'
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(ADL:(ARMv5(Instruction(Semantics(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 8(/(20(
def!execute_add(!s,!inst!):!!!!!if!condition_passed(!s,!inst.cond()!):!!!!!a,!!!=!s.rf[!inst.rn()!]!!!!!b,!_!=!shifter_operand(!s,!inst!)!!!!!result!=!a!+!b!!!!!s.rf[!inst.rd()!]!=!trim_32(result)!!!!!!!if!inst.S():!!!!!!!#!...!!!!!!!s.N!=!(result!>>!31)&1!!!!!!!s.Z!=!trim_32(result)!==!0!!!!!!!s.C!=!carry_from(result)!!!!!!!s.V!=!overflow_from(a,!b,!result)!!!!!!!if!inst.rd()!==!15:!!!!!!!return!!!s.rf[PC]!=!s.fetch_pc()!+!4'
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(ADL:(ARMv5(Instruction(Semantics(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 8(/(20(
def!execute_add(!s,!inst!):!!!!!if!condition_passed(!s,!inst.cond()!):!!!!!a,!!!=!s.rf[!inst.rn()!]!!!!!b,!_!=!shifter_operand(!s,!inst!)!!!!!result!=!a!+!b!!!!!s.rf[!inst.rd()!]!=!trim_32(result)!!!!!!!if!inst.S():!!!!!!!#!...!!!!!!!s.N!=!(result!>>!31)&1!!!!!!!s.Z!=!trim_32(result)!==!0!!!!!!!s.C!=!carry_from(result)!!!!!!!s.V!=!overflow_from(a,!b,!result)!!!!!!!if!inst.rd()!==!15:!!!!!!!return!!!s.rf[PC]!=!s.fetch_pc()!+!4'
if!ConditionPassed(cond)!then!!!!Rd!=!Rn!+!shifter_operand!!!!if!S!==!1!and!Rd!==!R15!then!!!!!if!CurrentModeHasSPSR()!then!!!!!!!!CPSR!=!SPSR!!!!!else!UNPREDICTABLE!!!!else!if!S!==!1!then!!!!!N!Flag!=!Rd[31]!!!!!Z!Flag!=!if!Rd!==!0!then!1!else!0!!!!!C!Flag!=!CarryFrom(Rn!+!shifter_operand)!!!!!V!Flag!=!OverflowFrom(Rn!+!shifter_operand)(
ARM(ISA(MANUAL(SPEC(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Pydgin(ADL:(ARMv5(Instruction(Semantics(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 8(/(20(
def!execute_add(!s,!inst!):!!!!!if!condition_passed(!s,!inst.cond()!):!!!!!a,!!!=!s.rf[!inst.rn()!]!!!!!b,!_!=!shifter_operand(!s,!inst!)!!!!!result!=!a!+!b!!!!!s.rf[!inst.rd()!]!=!trim_32(result)!!!!!!!if!inst.S():!!!!!!!#!...!!!!!!!s.N!=!(result!>>!31)&1!!!!!!!s.Z!=!trim_32(result)!==!0!!!!!!!s.C!=!carry_from(result)!!!!!!!s.V!=!overflow_from(a,!b,!result)!!!!!!!if!inst.rd()!==!15:!!!!!!!return!!!s.rf[PC]!=!s.fetch_pc()!+!4'
ARM(ISA(MANUAL(SPEC(
if!ConditionPassed(cond)!then!!!!Rd!=!Rn!+!shifter_operand!!!!if!S!==!1!and!Rd!==!R15!then!!!!!if!CurrentModeHasSPSR()!then!!!!!!!!CPSR!=!SPSR!!!!!else!UNPREDICTABLE!!!!else!if!S!==!1!then!!!!!N!Flag!=!Rd[31]!!!!!Z!Flag!=!if!Rd!==!0!then!1!else!0!!!!!C!Flag!=!CarryFrom(Rn!+!shifter_operand)!!!!!V!Flag!=!OverflowFrom(Rn!+!shifter_operand)(
RPython(ISS(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 9(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
RPython(ISS(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 9(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!
RPython(ISS(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 9(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!
RPython(ISS(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 9(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!
RPython(ISS(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 9(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!
RPython(ISS(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 9(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
>!python!iss.py!arm_binary(
!!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!!!'
The(RPython(Translation(Toolchain(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 10(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
The(RPython(Translation(Toolchain(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 10(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
RPython�Source
Type�Inference
Op�miza�on
Code�Genera�on
Compila�on
Compiled�Interpreter
The(RPython(Translation(Toolchain(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 10(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
RPython�Source
Type�Inference
Op�miza�on
Code�Genera�on
Compila�on
Compiled�Interpreter
>!./pydgin[nojit!arm_binary(
RPython(ISS(with(JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 11(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
!!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!!!'
RPython(ISS(with(JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 11(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
jd!=!JitDriver(!greens!=!['pc'],!!!!!!!!!!!!!!!!!reds!!!=!['state']!)!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!jd.jit_merge_point(!s.fetch_pc(),!state!)!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!!!!!!!if!state.fetch_pc()!<!pc:!!!!!!!!jd.can_enter_jit(!s.fetch_pc(),!state!)('
RPython(ISS(with(JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 11(/(20(
jd!=!JitDriver(!greens!=!['pc'],!!!!!!!!!!!!!!!!!reds!!!=!['state']!)!!!def!instruction_set_interpreter(!memory!):!!!state!=!State(!memory!)!!!!!while!True:!!!!!jd.jit_merge_point(!s.fetch_pc(),!state!)!!!!!!pc!!!!!!=!state.fetch_pc()!!!!!!!inst!!!!=!memory[!pc!]!!!!!!#!fetch!!!!!execute!=!decode(!inst!)!!!!#!decode!!!!!execute(!state,!inst!)!!!!!!#!execute!!!!!!!if!state.fetch_pc()!<!pc:!!!!!!!!jd.can_enter_jit(!s.fetch_pc(),!state!)('
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
The(RPython(Translation(Toolchain(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 12(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
RPython�Source
Type�Inference
Op�miza�on
Code�Genera�on
Compila�on
JIT�Generator
Compiled�Interpreter�with�JIT
The(RPython(Translation(Toolchain(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 12(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
RPython�Source
Type�Inference
Op�miza�on
Code�Genera�on
Compila�on
JIT�Generator
Compiled�Interpreter�with�JIT
>!./pydgin[jit!arm_binary(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 13(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 13(/(20(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 13(/(20(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons''
SPECINT2006(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 13(/(20(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons'
+ 'Elidable'Instruc>on'Fetch'(
SPECINT2006(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 13(/(20(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons'
+ 'Elidable'Instruc>on'Fetch'+ 'Elidable'Decode''
SPECINT2006(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons'
+ 'Elidable'Instruc>on'Fetch'+ 'Elidable'Decode'+ 'Constant'Promo>on'of'PC'and'Memory'
SPECINT2006(
13(/(20(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons'
+ 'Elidable'Instruc>on'Fetch'+ 'Elidable'Decode'+ 'Constant'Promo>on'of'PC'and'Memory'
+ 'Word?Based'Target'Memory'(
SPECINT2006(
13(/(20(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons'
+ 'Elidable'Instruc>on'Fetch'+ 'Elidable'Decode'+ 'Constant'Promo>on'of'PC'and'Memory'
+ 'Word?Based'Target'Memory'
+ 'Loop'Unrolling'in'Instruc>on'Seman>cs''
SPECINT2006(
13(/(20(
JIT(Annotations(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Crea-ng(a(compe--ve(JIT(requires(addi-onal(RPython(JIT(hints:(((+ 'Minimal'JIT'Annota>ons'
+ 'Elidable'Instruc>on'Fetch'+ 'Elidable'Decode'+ 'Constant'Promo>on'of'PC'and'Memory'
+ 'Word?Based'Target'Memory'
+ 'Loop'Unrolling'in'Instruc>on'Seman>cs'
+ 'Virtualizable'PC'and'Sta>s>cs'''
SPECINT2006(
13(/(20(
Pydgin(ISS(Evaluation(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Two(ISSs(implemented(in(Pydgin(• Simplified?MIPS'• ARMv5'
'
'
14(/(20(
Pydgin(ISS(Evaluation(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Two(ISSs(implemented(in(Pydgin(• Simplified?MIPS'• ARMv5'
Simplifica-ons(• GCC'cross?compiler'using'newlib'• emulated'system'calls'• “bare?metal”'system'(no'OS)''
14(/(20(
Pydgin(ISS(Evaluation(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Two(ISSs(implemented(in(Pydgin(• Simplified?MIPS:''87?761'MIPS'• ARMv5'
Simplifica-ons(• GCC'cross?compiler'using'newlib'• emulated'system'calls'• “bare?metal”'system'(no'OS)''
'
14(/(20(
Pydgin(ISS(Evaluation:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Two(ISSs(implemented(in(Pydgin(• Simplified?MIPS:''87?761'MIPS'• ARMv5'
Simplifica-ons(• GCC'cross?compiler'using'newlib'• emulated'system'calls'• “bare?metal”'system'(no'OS)''
ARMv5'ISSs:'• Interpre-ve:'gem5?atomic,'pydgin?nojit''
'14(/(20(
Pydgin(ISS(Evaluation:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Two(ISSs(implemented(in(Pydgin(• Simplified?MIPS:''87?761'MIPS'• ARMv5'
Simplifica-ons(• GCC'cross?compiler'using'newlib'• emulated'system'calls'• “bare?metal”'system'(no'OS)''
ARMv5'ISSs:'• Interpre-ve:'gem5?atomic,'pydgin?nojit'• DBT: ' 'simit?jit,'pydgin?jit,'qemu''
' 14(/(20(
Pydgin(ISS(Evaluation:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin(ADL(State'
Encoding'Seman>cs'
Pydgin''Interpreter'
Loop'
RPython'Transla>on'Toolchain'
Python(ISS(
Script(
Pydgin(ISS(
Executable(
Pydgin(DBT?ISS(
Executable(
Pydgin'JIT'
Annota>ons'
Two(ISSs(implemented(in(Pydgin(• Simplified?MIPS:''87?761'MIPS'• ARMv5'
Simplifica-ons(• GCC'cross?compiler'using'newlib'• emulated'system'calls'• “bare?metal”'system'(no'OS)''
ARMv5'ISSs:'• Interpre-ve:'gem5?atomic,'pydgin?nojit'• DBT: ' 'simit?jit,'pydgin?jit,'qemu*(
! !(*!not!fully!observable)''
'14(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Log(Scale(
15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
10x(
15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
200x(
15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 15(/(20(
ISS(Comparison:(ARMv5(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
poor'pydgin?jit'performance'due'to'large'number'of'trace'aborts'
15(/(20(
Performance(vs.(Maximum(Trace(Length(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 16(/(20(
Performance(vs.(Maximum(Trace(Length(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
speedup'normalized'to''results'in'the'paper'
16(/(20(
Performance(vs.(Maximum(Trace(Length(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
h264ref(
bzip2(
speedup'normalized'to''results'in'the'paper'
16(/(20(
Performance(vs.(Maximum(Trace(Length(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
h264ref(
bzip2(
speedup'normalized'to''results'in'the'paper'
16(/(20(
Results:(ARM(with(Longer(Traces(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Linear(Scale(
17(/(20(
Results:(ARM(with(Longer(Traces(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 17(/(20(
Results:(ARM(with(Longer(Traces(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
700+(MIPS!(
17(/(20(
Improving(with(RPython(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin'ISSs'benefit'from'performance'improvements'as'newer'versions'of'the'RPython'Transla>on'Toolchain'are'released.'
18(/(20(
Improving(with(RPython(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin'ISSs'benefit'from'performance'improvements'as'newer'versions'of'the'RPython'Transla>on'Toolchain'are'released.'
18(/(20(
Improving(with(RPython(
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin'ISSs'benefit'from'performance'improvements'as'newer'versions'of'the'RPython'Transla>on'Toolchain'are'released.'
15%(improvement(in(16(months(
18(/(20(
Conclusions(
Pydgin'provides'a'succinct,'embedded?DSL'within'Python'for'rapid'prototyping'of'ISAs'for'next?genera>on'hardware.''Pydgin'leverages'the'RPython'transla>on'toolchain'to'convert'these'descrip>ons'into'high?performance,'JIT?enabled'ISSs.''
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 19(/(20(
Conclusions(
Pydgin'provides'a'succinct,'embedded?DSL'within'Python'for'rapid'prototyping'of'ISAs'for'next?genera>on'hardware.''Pydgin'leverages'the'RPython'transla>on'toolchain'to'convert'these'descrip>ons'into'high?performance,'JIT?enabled'ISSs.''Many'opportuni>es'for'future'improvements:''• more'features'and'ISA'implementa>ons'• performance'op>miza>ons'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers( 19(/(20(
Conclusion(
Pydgin'is'a'produc>ve,'open?source(Python'framework'for'crea>ng'fast'instruc>on'set'simulators.'
''
hdps://github.com/cornell?brg/pydgin((
Thank'you'to'our'sponsors'for'their'support:''NSF,'DARPA,'and'dona>ons'from'Intel'Corpora>on'and'Synopsys,'Inc.'
Pydgin:(Genera-ng(Fast(Instruc-on(Set(Simulators(from(Simple(Architecture(Descrip-ons(with(Meta?Tracing(JIT(Compilers(
Pydgin
20(/(20(