Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Phil
Check in the mailing list mails from nick.lsts@gmail.com. This was an argentinian guy who did A LOT of effort trying to make Simulator work in Pharo....
On Thu, Apr 11, 2013 at 6:11 AM, phil@highoctane.be phil@highoctane.bewrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Phil
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.bewrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
On 11 April 2013 18:00, Eliot Miranda eliot.miranda@gmail.com wrote:
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.be wrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
It its Cog branch, i think.
Phil
-- best, Eliot
I am using the following version:
VMMaker oscog-EstebanLorenzano.236
Phil
2013/4/11 Igor Stasenko siguctua@gmail.com
On 11 April 2013 18:00, Eliot Miranda eliot.miranda@gmail.com wrote:
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.be
wrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it
looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the
Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with
self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
It its Cog branch, i think.
Phil
-- best, Eliot
-- Best regards, Igor Stasenko.
This is what I do have:
VMClass subclass: #InterpreterPrimitives VMClass subclass: #ObjectMemory ObjectMemory subclass: #Interpreter
and also:
InterpreterPrimitives subclass: #StackInterpreter StackInterpreter subclass: #StackInterpreterPrimitives
I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.
StackIntepreter simulation has other problems:
UndefinedObject(Object)>>doesNotUnderstand: #adaptToNumber:andSend: UndefinedObject(Object)>>adaptToInteger:andSend: SmallInteger(Integer)>>quo: SmallInteger>>quo: SmallInteger(Integer)>>// SmallInteger>>// StackInterpreterSimulatorLSB(StackInterpreter)>>interpreterAllocationReserveBytes StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName.... BlockClosure>>ensure: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn: UndefinedObject>>DoIt
Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)
Phil
2013/4/11 Eliot Miranda eliot.miranda@gmail.com
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.bewrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
-- best, Eliot
On Fri, Apr 12, 2013 at 2:43 AM, phil@highoctane.be phil@highoctane.bewrote:
This is what I do have:
VMClass subclass: #InterpreterPrimitives VMClass subclass: #ObjectMemory ObjectMemory subclass: #Interpreter
and also:
InterpreterPrimitives subclass: #StackInterpreter StackInterpreter subclass: #StackInterpreterPrimitives
I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.
Then I would either move to VMMaker or be prepared for a fair bit of work. I haven't worked on the Interpreter in the Cog branch for many years.
StackIntepreter simulation has other problems:
UndefinedObject(Object)>>doesNotUnderstand: #adaptToNumber:andSend: UndefinedObject(Object)>>adaptToInteger:andSend: SmallInteger(Integer)>>quo: SmallInteger>>quo: SmallInteger(Integer)>>// SmallInteger>>//
StackInterpreterSimulatorLSB(StackInterpreter)>>interpreterAllocationReserveBytes StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName.... BlockClosure>>ensure:
StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn: UndefinedObject>>DoIt
Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)
This should be easy to solve. Hmmm, works in e.g. VMMaker.oscog-eem.284.
Try launching it with
| vm | StackInterpreter initializeWithOptions: (Dictionary newFromPairs: #()). vm := StackInterpreterSimulator new. vm openOn: 'some.image'. vm openAsMorph; run
If it doesn't work then you need to reintegrate from VMMaker.oscog-eem.284.
HTH Eliot
Phil
2013/4/11 Eliot Miranda eliot.miranda@gmail.com
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.bewrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
-- best, Eliot
Thanks!
A question: loading VMMaker tells me the following. Why should I load beforehand?
This package depends on the following classes: FFIConstants KlattResonatorIndices You must resolve these dependencies before you will be able to load these definitions: FFIPlugin declareCVarsIn: hasHeaderFile moduleName requiresPlatformFiles atomicTypeOf: ffiAddressOf:startingAt:size: ffiArgByValue: ffiArgument:Spec:Class: ffiAtomicArgByReference:Class: ffiAtomicStructByReference:Class: ffiCall:WithFlags:AndTypes: ffiCall:WithFlags:Args:AndTypes:OfSize: ffiCalloutTo:WithFlags: ffiCheckReturn:With: ffiContentsOfHandle:errCode: ffiCreateLongLongReturn: ffiCreateReturn: ffiCreateReturnOop: ffiCreateReturnPointer: ffiCreateReturnStruct ffiFail: ffiFloatValueOf: ffiGetLastError ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushPointerContentsOf: ffiPushSignedLongLongOop: ffiPushStructureContentsOf: ffiPushUnsignedLongLongOop: ffiPushVoid: ffiReturnCStringFrom: ffiSetLastError: ffiValidateExternalData:AtomicType: initialiseModule isAtomicType: primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer KlattSynthesizerPlugin declareCVarsIn: initialize moduleName addAmplitudeDiplophonia addFlutter addFrequencyDiplophonia addJitter addShimmer antiResonator:frequency:bandwidth: antiResonator:value: cascadeBranch: checkedFloatPtrOf: checkedShortPtrOf: glottalSource linearFromdB: loadFrom: nextRandom normalizeGlottalPulse parallelFrictionBranch: parallelVoicedBranch: pitchSynchronousReset primitiveSynthesizeFrameIntoStartingAt qu:phi:cosphi:sinphi:rphid: resonator:frequency:bandwidth: resonator:frequency:bandwidth:gain: resonator:value: resonatorA: resonatorA:put: resonatorB: resonatorB:put: resonatorC: resonatorC:put: resonatorP1: resonatorP1:put: resonatorP2: resonatorP2:put: ro:ra:rk: saveTo: setCurrentFrame: synthesizeFrame:into:startingAt: voicedPitchSynchronousReset zeroQphi:cosphi:sinphi:rphid: ThreadedARMFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop ThreadedFFIPlugin ancilliaryStructClasses calloutStateClass declareCVarsIn: initialize maxNumArgs moduleName preambleCCode prepareToBeAddedToCodeGenerator: allocaLiesSoUseGetsp atomicTypeOf: cStackAlignment cleanupCalloutState: dispatchFunctionPointer: externalFunctionHasStackSizeSlot ffiAddressOf:startingAt:size: ffiAlloc: ffiArgByValue:in: ffiArgument:Spec:Class:in: ffiAtomicArgByReference:Class:in: ffiAtomicStructByReference:Class:in: ffiCall:ArgArrayOrNil:NumArgs: ffiCalloutTo:SpecOnStack:in: ffiCheckReturn:With:in: ffiContentsOfHandle:errCode: ffiCreateIntegralResultOop:ofAtomicType:in: ffiFail: ffiFloatValueOf: ffiFree: ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushPointerContentsOf:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedLongLongOop:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushString:OfLength:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushStructureContentsOf:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedLongLongOop:in: ffiPushUnsignedShort:in: ffiPushVoid:in: ffiReturnCStringFrom: ffiReturnPointer:ofType:in: ffiReturnStruct:ofType:in: ffiReturnType: ffiSupportsCallingConvention: ffiValidateExternalData:AtomicType: initialiseModule isAlien: isAtomicType: isCalleePopsConvention: isDirectAlien: nonRegisterStructReturnIsViaImplicitFirstArgument primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer registerArgsSlop returnStructInRegisters: sizeField: startOfData: ThreadedIA32FFIPlugin ffiCalloutTo:SpecOnStack:in: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: ffiReturnStruct:ofType:in: registerArgsSlop returnStructInRegisters: ThreadedPPCBEFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop returnStructInRegisters:
Select Proceed to continue, or close this window to cancel the operation.
2013/4/12 Eliot Miranda eliot.miranda@gmail.com
On Fri, Apr 12, 2013 at 2:43 AM, phil@highoctane.be phil@highoctane.bewrote:
This is what I do have:
VMClass subclass: #InterpreterPrimitives VMClass subclass: #ObjectMemory ObjectMemory subclass: #Interpreter
and also:
InterpreterPrimitives subclass: #StackInterpreter StackInterpreter subclass: #StackInterpreterPrimitives
I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.
Then I would either move to VMMaker or be prepared for a fair bit of work. I haven't worked on the Interpreter in the Cog branch for many years.
StackIntepreter simulation has other problems:
UndefinedObject(Object)>>doesNotUnderstand: #adaptToNumber:andSend: UndefinedObject(Object)>>adaptToInteger:andSend: SmallInteger(Integer)>>quo: SmallInteger>>quo: SmallInteger(Integer)>>// SmallInteger>>//
StackInterpreterSimulatorLSB(StackInterpreter)>>interpreterAllocationReserveBytes StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName.... BlockClosure>>ensure:
StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn: UndefinedObject>>DoIt
Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)
This should be easy to solve. Hmmm, works in e.g. VMMaker.oscog-eem.284.
Try launching it with
| vm | StackInterpreter initializeWithOptions: (Dictionary newFromPairs: #()). vm := StackInterpreterSimulator new. vm openOn: 'some.image'. vm openAsMorph; run
If it doesn't work then you need to reintegrate from VMMaker.oscog-eem.284.
HTH Eliot
Phil
2013/4/11 Eliot Miranda eliot.miranda@gmail.com
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.bewrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
-- best, Eliot
-- best, Eliot
On 12.04.2013, at 11:37, "phil@highoctane.be" phil@highoctane.be wrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load beforehand?
You can use the config map to load it.
- Bert -
Config map?
2013/4/12 Bert Freudenberg bert@freudenbergs.de
On 12.04.2013, at 11:37, "phil@highoctane.be" phil@highoctane.be wrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load
beforehand?
You can use the config map to load it.
- Bert -
On 12.04.2013, at 13:13, phil@highoctane.be wrote:
Config map?
Since you are interested in the interpreter, use the interpreter's config map.
The current one is "update-dtl.12" in the VMMaker repo. Select it, and hit the "Load" button.
After that, do:
VMMaker updateFromServer
to get the latest.
- Bert -
2013/4/12 Bert Freudenberg bert@freudenbergs.de
On 12.04.2013, at 11:37, "phil@highoctane.be" phil@highoctane.be wrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load beforehand?
You can use the config map to load it.
- Bert -
Educated I now stand. Thanks.
2013/4/13 Bert Freudenberg bert@freudenbergs.de
On 12.04.2013, at 13:13, phil@highoctane.be wrote:
Config map?
Since you are interested in the interpreter, use the interpreter's config map.
The current one is "update-dtl.12" in the VMMaker repo. Select it, and hit the "Load" button.
After that, do:
VMMaker updateFromServer
to get the latest.
- Bert -
2013/4/12 Bert Freudenberg bert@freudenbergs.de
On 12.04.2013, at 11:37, "phil@highoctane.be" phil@highoctane.be
wrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load
beforehand?
You can use the config map to load it.
- Bert -
why don't you use the ConfigurationOfCog?
On Apr 12, 2013, at 8:37 PM, phil@highoctane.be wrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load beforehand?
This package depends on the following classes: FFIConstants KlattResonatorIndices You must resolve these dependencies before you will be able to load these definitions: FFIPlugin declareCVarsIn: hasHeaderFile moduleName requiresPlatformFiles atomicTypeOf: ffiAddressOf:startingAt:size: ffiArgByValue: ffiArgument:Spec:Class: ffiAtomicArgByReference:Class: ffiAtomicStructByReference:Class: ffiCall:WithFlags:AndTypes: ffiCall:WithFlags:Args:AndTypes:OfSize: ffiCalloutTo:WithFlags: ffiCheckReturn:With: ffiContentsOfHandle:errCode: ffiCreateLongLongReturn: ffiCreateReturn: ffiCreateReturnOop: ffiCreateReturnPointer: ffiCreateReturnStruct ffiFail: ffiFloatValueOf: ffiGetLastError ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushPointerContentsOf: ffiPushSignedLongLongOop: ffiPushStructureContentsOf: ffiPushUnsignedLongLongOop: ffiPushVoid: ffiReturnCStringFrom: ffiSetLastError: ffiValidateExternalData:AtomicType: initialiseModule isAtomicType: primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer KlattSynthesizerPlugin declareCVarsIn: initialize moduleName addAmplitudeDiplophonia addFlutter addFrequencyDiplophonia addJitter addShimmer antiResonator:frequency:bandwidth: antiResonator:value: cascadeBranch: checkedFloatPtrOf: checkedShortPtrOf: glottalSource linearFromdB: loadFrom: nextRandom normalizeGlottalPulse parallelFrictionBranch: parallelVoicedBranch: pitchSynchronousReset primitiveSynthesizeFrameIntoStartingAt qu:phi:cosphi:sinphi:rphid: resonator:frequency:bandwidth: resonator:frequency:bandwidth:gain: resonator:value: resonatorA: resonatorA:put: resonatorB: resonatorB:put: resonatorC: resonatorC:put: resonatorP1: resonatorP1:put: resonatorP2: resonatorP2:put: ro:ra:rk: saveTo: setCurrentFrame: synthesizeFrame:into:startingAt: voicedPitchSynchronousReset zeroQphi:cosphi:sinphi:rphid: ThreadedARMFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop ThreadedFFIPlugin ancilliaryStructClasses calloutStateClass declareCVarsIn: initialize maxNumArgs moduleName preambleCCode prepareToBeAddedToCodeGenerator: allocaLiesSoUseGetsp atomicTypeOf: cStackAlignment cleanupCalloutState: dispatchFunctionPointer: externalFunctionHasStackSizeSlot ffiAddressOf:startingAt:size: ffiAlloc: ffiArgByValue:in: ffiArgument:Spec:Class:in: ffiAtomicArgByReference:Class:in: ffiAtomicStructByReference:Class:in: ffiCall:ArgArrayOrNil:NumArgs: ffiCalloutTo:SpecOnStack:in: ffiCheckReturn:With:in: ffiContentsOfHandle:errCode: ffiCreateIntegralResultOop:ofAtomicType:in: ffiFail: ffiFloatValueOf: ffiFree: ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushPointerContentsOf:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedLongLongOop:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushString:OfLength:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushStructureContentsOf:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedLongLongOop:in: ffiPushUnsignedShort:in: ffiPushVoid:in: ffiReturnCStringFrom: ffiReturnPointer:ofType:in: ffiReturnStruct:ofType:in: ffiReturnType: ffiSupportsCallingConvention: ffiValidateExternalData:AtomicType: initialiseModule isAlien: isAtomicType: isCalleePopsConvention: isDirectAlien: nonRegisterStructReturnIsViaImplicitFirstArgument primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer registerArgsSlop returnStructInRegisters: sizeField: startOfData: ThreadedIA32FFIPlugin ffiCalloutTo:SpecOnStack:in: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: ffiReturnStruct:ofType:in: registerArgsSlop returnStructInRegisters: ThreadedPPCBEFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop returnStructInRegisters:
Select Proceed to continue, or close this window to cancel the operation.
2013/4/12 Eliot Miranda eliot.miranda@gmail.com
On Fri, Apr 12, 2013 at 2:43 AM, phil@highoctane.be phil@highoctane.be wrote:
This is what I do have:
VMClass subclass: #InterpreterPrimitives VMClass subclass: #ObjectMemory ObjectMemory subclass: #Interpreter
and also:
InterpreterPrimitives subclass: #StackInterpreter StackInterpreter subclass: #StackInterpreterPrimitives
I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.
Then I would either move to VMMaker or be prepared for a fair bit of work. I haven't worked on the Interpreter in the Cog branch for many years.
StackIntepreter simulation has other problems:
UndefinedObject(Object)>>doesNotUnderstand: #adaptToNumber:andSend: UndefinedObject(Object)>>adaptToInteger:andSend: SmallInteger(Integer)>>quo: SmallInteger>>quo: SmallInteger(Integer)>>// SmallInteger>>// StackInterpreterSimulatorLSB(StackInterpreter)>>interpreterAllocationReserveBytes StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName.... BlockClosure>>ensure: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn: UndefinedObject>>DoIt
Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)
This should be easy to solve. Hmmm, works in e.g. VMMaker.oscog-eem.284.
Try launching it with
| vm | StackInterpreter initializeWithOptions: (Dictionary newFromPairs: #()). vm := StackInterpreterSimulator new. vm openOn: 'some.image'. vm openAsMorph; run
If it doesn't work then you need to reintegrate from VMMaker.oscog-eem.284.
HTH Eliot
Phil
2013/4/11 Eliot Miranda eliot.miranda@gmail.com
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be phil@highoctane.be wrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
-- best, Eliot
-- best, Eliot
Indeed. Thanks for pointing that out.
Reason why: I am figuring out a lot of stuff lately :-)
Phil
2013/4/12 Esteban Lorenzano estebanlm@gmail.com
why don't you use the ConfigurationOfCog?
On Apr 12, 2013, at 8:37 PM, phil@highoctane.be wrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load beforehand?
This package depends on the following classes: FFIConstants KlattResonatorIndices You must resolve these dependencies before you will be able to load these definitions: FFIPlugin declareCVarsIn: hasHeaderFile moduleName requiresPlatformFiles atomicTypeOf: ffiAddressOf:startingAt:size: ffiArgByValue: ffiArgument:Spec:Class: ffiAtomicArgByReference:Class: ffiAtomicStructByReference:Class: ffiCall:WithFlags:AndTypes: ffiCall:WithFlags:Args:AndTypes:OfSize: ffiCalloutTo:WithFlags: ffiCheckReturn:With: ffiContentsOfHandle:errCode: ffiCreateLongLongReturn: ffiCreateReturn: ffiCreateReturnOop: ffiCreateReturnPointer: ffiCreateReturnStruct ffiFail: ffiFloatValueOf: ffiGetLastError ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushPointerContentsOf: ffiPushSignedLongLongOop: ffiPushStructureContentsOf: ffiPushUnsignedLongLongOop: ffiPushVoid: ffiReturnCStringFrom: ffiSetLastError: ffiValidateExternalData:AtomicType: initialiseModule isAtomicType: primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer KlattSynthesizerPlugin declareCVarsIn: initialize moduleName addAmplitudeDiplophonia addFlutter addFrequencyDiplophonia addJitter addShimmer antiResonator:frequency:bandwidth: antiResonator:value: cascadeBranch: checkedFloatPtrOf: checkedShortPtrOf: glottalSource linearFromdB: loadFrom: nextRandom normalizeGlottalPulse parallelFrictionBranch: parallelVoicedBranch: pitchSynchronousReset primitiveSynthesizeFrameIntoStartingAt qu:phi:cosphi:sinphi:rphid: resonator:frequency:bandwidth: resonator:frequency:bandwidth:gain: resonator:value: resonatorA: resonatorA:put: resonatorB: resonatorB:put: resonatorC: resonatorC:put: resonatorP1: resonatorP1:put: resonatorP2: resonatorP2:put: ro:ra:rk: saveTo: setCurrentFrame: synthesizeFrame:into:startingAt: voicedPitchSynchronousReset zeroQphi:cosphi:sinphi:rphid: ThreadedARMFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop ThreadedFFIPlugin ancilliaryStructClasses calloutStateClass declareCVarsIn: initialize maxNumArgs moduleName preambleCCode prepareToBeAddedToCodeGenerator: allocaLiesSoUseGetsp atomicTypeOf: cStackAlignment cleanupCalloutState: dispatchFunctionPointer: externalFunctionHasStackSizeSlot ffiAddressOf:startingAt:size: ffiAlloc: ffiArgByValue:in: ffiArgument:Spec:Class:in: ffiAtomicArgByReference:Class:in: ffiAtomicStructByReference:Class:in: ffiCall:ArgArrayOrNil:NumArgs: ffiCalloutTo:SpecOnStack:in: ffiCheckReturn:With:in: ffiContentsOfHandle:errCode: ffiCreateIntegralResultOop:ofAtomicType:in: ffiFail: ffiFloatValueOf: ffiFree: ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushPointerContentsOf:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedLongLongOop:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushString:OfLength:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushStructureContentsOf:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedLongLongOop:in: ffiPushUnsignedShort:in: ffiPushVoid:in: ffiReturnCStringFrom: ffiReturnPointer:ofType:in: ffiReturnStruct:ofType:in: ffiReturnType: ffiSupportsCallingConvention: ffiValidateExternalData:AtomicType: initialiseModule isAlien: isAtomicType: isCalleePopsConvention: isDirectAlien: nonRegisterStructReturnIsViaImplicitFirstArgument primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer registerArgsSlop returnStructInRegisters: sizeField: startOfData: ThreadedIA32FFIPlugin ffiCalloutTo:SpecOnStack:in: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: ffiReturnStruct:ofType:in: registerArgsSlop returnStructInRegisters: ThreadedPPCBEFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop returnStructInRegisters:
Select Proceed to continue, or close this window to cancel the operation.
2013/4/12 Eliot Miranda eliot.miranda@gmail.com
On Fri, Apr 12, 2013 at 2:43 AM, phil@highoctane.be phil@highoctane.bewrote:
This is what I do have:
VMClass subclass: #InterpreterPrimitives VMClass subclass: #ObjectMemory ObjectMemory subclass: #Interpreter
and also:
InterpreterPrimitives subclass: #StackInterpreter StackInterpreter subclass: #StackInterpreterPrimitives
I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.
Then I would either move to VMMaker or be prepared for a fair bit of work. I haven't worked on the Interpreter in the Cog branch for many years.
StackIntepreter simulation has other problems:
UndefinedObject(Object)>>doesNotUnderstand: #adaptToNumber:andSend: UndefinedObject(Object)>>adaptToInteger:andSend: SmallInteger(Integer)>>quo: SmallInteger>>quo: SmallInteger(Integer)>>// SmallInteger>>//
StackInterpreterSimulatorLSB(StackInterpreter)>>interpreterAllocationReserveBytes StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName.... BlockClosure>>ensure:
StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn: UndefinedObject>>DoIt
Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)
This should be easy to solve. Hmmm, works in e.g. VMMaker.oscog-eem.284.
Try launching it with
| vm | StackInterpreter initializeWithOptions: (Dictionary newFromPairs: #()). vm := StackInterpreterSimulator new. vm openOn: 'some.image'. vm openAsMorph; run
If it doesn't work then you need to reintegrate from VMMaker.oscog-eem.284.
HTH Eliot
Phil
2013/4/11 Eliot Miranda eliot.miranda@gmail.com
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be <phil@highoctane.be
wrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
-- best, Eliot
-- best, Eliot
On Fri, Apr 12, 2013 at 11:37 AM, phil@highoctane.be phil@highoctane.bewrote:
Thanks!
A question: loading VMMaker tells me the following. Why should I load beforehand?
This page describes what you need for VMMaker.oscog to load:
http://www.mirandabanda.org/cogblog/build-image/
But the config approach is a lot easier :)
This package depends on the following classes: FFIConstants KlattResonatorIndices You must resolve these dependencies before you will be able to load these definitions: FFIPlugin declareCVarsIn: hasHeaderFile moduleName requiresPlatformFiles atomicTypeOf: ffiAddressOf:startingAt:size: ffiArgByValue: ffiArgument:Spec:Class: ffiAtomicArgByReference:Class: ffiAtomicStructByReference:Class: ffiCall:WithFlags:AndTypes: ffiCall:WithFlags:Args:AndTypes:OfSize: ffiCalloutTo:WithFlags: ffiCheckReturn:With: ffiContentsOfHandle:errCode: ffiCreateLongLongReturn: ffiCreateReturn: ffiCreateReturnOop: ffiCreateReturnPointer: ffiCreateReturnStruct ffiFail: ffiFloatValueOf: ffiGetLastError ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushPointerContentsOf: ffiPushSignedLongLongOop: ffiPushStructureContentsOf: ffiPushUnsignedLongLongOop: ffiPushVoid: ffiReturnCStringFrom: ffiSetLastError: ffiValidateExternalData:AtomicType: initialiseModule isAtomicType: primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer KlattSynthesizerPlugin declareCVarsIn: initialize moduleName addAmplitudeDiplophonia addFlutter addFrequencyDiplophonia addJitter addShimmer antiResonator:frequency:bandwidth: antiResonator:value: cascadeBranch: checkedFloatPtrOf: checkedShortPtrOf: glottalSource linearFromdB: loadFrom: nextRandom normalizeGlottalPulse parallelFrictionBranch: parallelVoicedBranch: pitchSynchronousReset primitiveSynthesizeFrameIntoStartingAt qu:phi:cosphi:sinphi:rphid: resonator:frequency:bandwidth: resonator:frequency:bandwidth:gain: resonator:value: resonatorA: resonatorA:put: resonatorB: resonatorB:put: resonatorC: resonatorC:put: resonatorP1: resonatorP1:put: resonatorP2: resonatorP2:put: ro:ra:rk: saveTo: setCurrentFrame: synthesizeFrame:into:startingAt: voicedPitchSynchronousReset zeroQphi:cosphi:sinphi:rphid: ThreadedARMFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop ThreadedFFIPlugin ancilliaryStructClasses calloutStateClass declareCVarsIn: initialize maxNumArgs moduleName preambleCCode prepareToBeAddedToCodeGenerator: allocaLiesSoUseGetsp atomicTypeOf: cStackAlignment cleanupCalloutState: dispatchFunctionPointer: externalFunctionHasStackSizeSlot ffiAddressOf:startingAt:size: ffiAlloc: ffiArgByValue:in: ffiArgument:Spec:Class:in: ffiAtomicArgByReference:Class:in: ffiAtomicStructByReference:Class:in: ffiCall:ArgArrayOrNil:NumArgs: ffiCalloutTo:SpecOnStack:in: ffiCheckReturn:With:in: ffiContentsOfHandle:errCode: ffiCreateIntegralResultOop:ofAtomicType:in: ffiFail: ffiFloatValueOf: ffiFree: ffiIntegerValueOf: ffiLoadCalloutAddress: ffiLoadCalloutAddressFrom: ffiLoadCalloutModule: ffiLogCallout: ffiLogCallsTo: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushPointerContentsOf:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedLongLongOop:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushString:OfLength:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushStructureContentsOf:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedLongLongOop:in: ffiPushUnsignedShort:in: ffiPushVoid:in: ffiReturnCStringFrom: ffiReturnPointer:ofType:in: ffiReturnStruct:ofType:in: ffiReturnType: ffiSupportsCallingConvention: ffiValidateExternalData:AtomicType: initialiseModule isAlien: isAtomicType: isCalleePopsConvention: isDirectAlien: nonRegisterStructReturnIsViaImplicitFirstArgument primitiveCallout primitiveCalloutWithArgs primitiveCreateManualSurface primitiveDestroyManualSurface primitiveFFIAllocate primitiveFFIDoubleAt primitiveFFIDoubleAtPut primitiveFFIFloatAt primitiveFFIFloatAtPut primitiveFFIFree primitiveFFIGetLastError primitiveFFIIntegerAt primitiveFFIIntegerAtPut primitiveForceLoad primitiveLogCallsTo primitiveSetManualSurfacePointer registerArgsSlop returnStructInRegisters: sizeField: startOfData: ThreadedIA32FFIPlugin ffiCalloutTo:SpecOnStack:in: ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushStructure:ofSize:typeSpec:ofLength:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: ffiReturnStruct:ofType:in: registerArgsSlop returnStructInRegisters: ThreadedPPCBEFFIPlugin calloutStateClass initialize numRegArgs ffiPushDoubleFloat:in: ffiPushPointer:in: ffiPushSignedByte:in: ffiPushSignedChar:in: ffiPushSignedInt:in: ffiPushSignedLongLong:in: ffiPushSignedShort:in: ffiPushSingleFloat:in: ffiPushUnsignedByte:in: ffiPushUnsignedChar:in: ffiPushUnsignedInt:in: ffiPushUnsignedLong:in: ffiPushUnsignedLongLong:in: ffiPushUnsignedShort:in: registerArgsSlop returnStructInRegisters:
Select Proceed to continue, or close this window to cancel the operation.
2013/4/12 Eliot Miranda eliot.miranda@gmail.com
On Fri, Apr 12, 2013 at 2:43 AM, phil@highoctane.be phil@highoctane.bewrote:
This is what I do have:
VMClass subclass: #InterpreterPrimitives VMClass subclass: #ObjectMemory ObjectMemory subclass: #Interpreter
and also:
InterpreterPrimitives subclass: #StackInterpreter StackInterpreter subclass: #StackInterpreterPrimitives
I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.
Then I would either move to VMMaker or be prepared for a fair bit of work. I haven't worked on the Interpreter in the Cog branch for many years.
StackIntepreter simulation has other problems:
UndefinedObject(Object)>>doesNotUnderstand: #adaptToNumber:andSend: UndefinedObject(Object)>>adaptToInteger:andSend: SmallInteger(Integer)>>quo: SmallInteger>>quo: SmallInteger(Integer)>>// SmallInteger>>//
StackInterpreterSimulatorLSB(StackInterpreter)>>interpreterAllocationReserveBytes StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName.... BlockClosure>>ensure:
StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn:extraMemory: StackInterpreterSimulatorLSB(StackInterpreterSimulator)>>openOn: UndefinedObject>>DoIt
Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)
This should be easy to solve. Hmmm, works in e.g. VMMaker.oscog-eem.284.
Try launching it with
| vm | StackInterpreter initializeWithOptions: (Dictionary newFromPairs: #()). vm := StackInterpreterSimulator new. vm openOn: 'some.image'. vm openAsMorph; run
If it doesn't work then you need to reintegrate from VMMaker.oscog-eem.284.
HTH Eliot
Phil
2013/4/11 Eliot Miranda eliot.miranda@gmail.com
On Thu, Apr 11, 2013 at 2:11 AM, phil@highoctane.be <phil@highoctane.be
wrote:
Hello,
I've been working on getting the simulator to work from VMMaker.
Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).
Then, I am now running the test of the sim:
test transcript clear. byteCount := 0. quitBlock := [^ self]. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable. byteCount := byteCount + 1. byteCount \ 10000 = 0 ifTrue: [self fullDisplay]]. self externalizeIPandSP.
and I hit an issue:
MNU: isInstanceOfClassFloat: oop. InterpreterSimulatorLSB(Interpreter)>>floatValueOf: InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom: InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg: InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in: InterpreterSimulatorLSB(InterpreterSimulator)>>test UndefinedObject>>DoIt
This happens here:
floatValueOf: oop "Answer the C double precision floating point value of the argument, or fail if it is not a Float, and answer 0. Note: May be called by translated primitive code."
| isFloat result | <returnTypeC: #double> <var: #result type: #double> isFloat := self isInstanceOfClassFloat: oop. isFloat ifTrue: [self cCode: '' inSmalltalk: [result := Float new: 2]. self fetchFloatAt: oop + BaseHeaderSize into: result. ^result]. self primitiveFail. ^0.0
There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.
InterpreterPrimitives>>isInstanceOfClassFloat: oop <inline: true> "N.B. Because Slang always inlines is:instanceOf:compactClassIndex: (because is:instanceOf:compactClassIndex: has an inline: pragma) the phrase (objectMemory splObj: ClassFloat) is expanded in-place and is _not_ evaluated if oop has a non-zero CompactClassIndex." ^objectMemory is: oop instanceOf: (objectMemory splObj: ClassFloat) compactClassIndex: ClassFloatCompactIndex
Clues?
Just copy the method into Interpreter and replace objectMemory with self. But I don't understand which VMMsker you're using. In David Lewis' trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.
Phil
-- best, Eliot
-- best, Eliot
On 12 April 2013 17:43, Eliot Miranda eliot.miranda@gmail.com wrote:
Then I would either move to VMMaker or be prepared for a fair bit of work. I haven't worked on the Interpreter in the Cog branch for many years.
Then i suggest, what about killing that class in cog branch of VMMaker.. it makes no sense to keep old and unmaintained cruft anyways.. just another source of confusion and bloat..
and later when/if squeak interpreter will be merged with stack one, we can reintroduce it by taking it from squeak branch.
On Fri, Apr 12, 2013 at 2:14 PM, Igor Stasenko siguctua@gmail.com wrote:
On 12 April 2013 17:43, Eliot Miranda eliot.miranda@gmail.com wrote:
Then I would either move to VMMaker or be prepared for a fair bit of
work. I haven't worked on the Interpreter in the Cog branch for many years.
Then i suggest, what about killing that class in cog branch of VMMaker.. it makes no sense to keep old and unmaintained cruft anyways.. just another source of confusion and bloat..
Trouble is there's good stuff in there like Andreas' profiler support for the interpreter. So there is stiuff that needs to be merged from Interpreter into the main line too. It must stay until the merge and then all of the classes will pair up.
and later when/if squeak interpreter will be merged with stack one, we can reintroduce it by taking it from squeak branch.
-- Best regards, Igor Stasenko.
On Fri, Apr 12, 2013 at 03:01:26PM -0700, Eliot Miranda wrote:
On Fri, Apr 12, 2013 at 2:14 PM, Igor Stasenko siguctua@gmail.com wrote:
On 12 April 2013 17:43, Eliot Miranda eliot.miranda@gmail.com wrote:
Then I would either move to VMMaker or be prepared for a fair bit of
work. I haven't worked on the Interpreter in the Cog branch for many years.
Then i suggest, what about killing that class in cog branch of VMMaker.. it makes no sense to keep old and unmaintained cruft anyways.. just another source of confusion and bloat..
Trouble is there's good stuff in there like Andreas' profiler support for the interpreter. So there is stiuff that needs to be merged from Interpreter into the main line too. It must stay until the merge and then all of the classes will pair up.
Indeed. I know it does not look like it, but I'm actively working on merging things like this in the VMM trunk, and I need to be able to see things like this in the oscog branch in order to understand them. Especially since I'm usually dealing with stuff I actually *don't* understand ;-)
Andreas' profiler is a great example. I still don't have it working right, but I'll figure it out one of these days, or maybe someone else will. But there would be no chance of getting it right if we did not have the code in oscog for reference.
Dave
As well as the UI tool for plugins and generation (spent a while getting this to show in Pharo but apart from seeing the list of plugins, there is litte value (and Utilities is used in a number of places).
Phil, still fighting the StackIntepreter simulation.
2013/4/12 Igor Stasenko siguctua@gmail.com
On 12 April 2013 17:43, Eliot Miranda eliot.miranda@gmail.com wrote:
Then I would either move to VMMaker or be prepared for a fair bit of
work. I haven't worked on the Interpreter in the Cog branch for many years.
Then i suggest, what about killing that class in cog branch of VMMaker.. it makes no sense to keep old and unmaintained cruft anyways.. just another source of confusion and bloat..
and later when/if squeak interpreter will be merged with stack one, we can reintroduce it by taking it from squeak branch.
-- Best regards, Igor Stasenko.
vm-dev@lists.squeakfoundation.org