<br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 11:37 AM, <a href="mailto:phil@highoctane.be">phil@highoctane.be</a> <span dir="ltr">&lt;<a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><div>Thanks!</div><div><br></div><div>A question: loading VMMaker tells me the following. Why should I load beforehand?</div>
</div></blockquote><div><br></div><div>This page describes what you need for VMMaker.oscog to load:</div><div><br></div><div><a href="http://www.mirandabanda.org/cogblog/build-image/">http://www.mirandabanda.org/cogblog/build-image/</a></div>
<div><br></div><div>But the config approach is a lot easier :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><br>
</div><div>This package depends on the following classes:</div>

<div>  FFIConstants</div><div>  KlattResonatorIndices</div><div>You must resolve these dependencies before you will be able to load these definitions: </div>
<div>  FFIPlugin</div><div>  declareCVarsIn:</div><div>  hasHeaderFile</div><div>  moduleName</div><div>  requiresPlatformFiles</div><div>  atomicTypeOf:</div><div>  ffiAddressOf:startingAt:size:</div><div>  ffiArgByValue:</div>



<div>  ffiArgument:Spec:Class:</div><div>  ffiAtomicArgByReference:Class:</div><div>  ffiAtomicStructByReference:Class:</div><div>  ffiCall:WithFlags:AndTypes:</div><div>  ffiCall:WithFlags:Args:AndTypes:OfSize:</div><div>



  ffiCalloutTo:WithFlags:</div><div>  ffiCheckReturn:With:</div><div>  ffiContentsOfHandle:errCode:</div><div>  ffiCreateLongLongReturn:</div><div>  ffiCreateReturn:</div><div>  ffiCreateReturnOop:</div><div>  ffiCreateReturnPointer:</div>



<div>  ffiCreateReturnStruct</div><div>  ffiFail:</div><div>  ffiFloatValueOf:</div><div>  ffiGetLastError</div><div>  ffiIntegerValueOf:</div><div>  ffiLoadCalloutAddress:</div><div>  ffiLoadCalloutAddressFrom:</div><div>



  ffiLoadCalloutModule:</div><div>  ffiLogCallout:</div><div>  ffiLogCallsTo:</div><div>  ffiPushPointerContentsOf:</div><div>  ffiPushSignedLongLongOop:</div><div>  ffiPushStructureContentsOf:</div><div>  ffiPushUnsignedLongLongOop:</div>



<div>  ffiPushVoid:</div><div>  ffiReturnCStringFrom:</div><div>  ffiSetLastError:</div><div>  ffiValidateExternalData:AtomicType:</div><div>  initialiseModule</div><div>  isAtomicType:</div><div>  primitiveCallout</div>


<div>
  primitiveCalloutWithArgs</div><div>  primitiveCreateManualSurface</div><div>  primitiveDestroyManualSurface</div><div>  primitiveFFIAllocate</div><div>  primitiveFFIDoubleAt</div><div>  primitiveFFIDoubleAtPut</div><div>



  primitiveFFIFloatAt</div><div>  primitiveFFIFloatAtPut</div><div>  primitiveFFIFree</div><div>  primitiveFFIGetLastError</div><div>  primitiveFFIIntegerAt</div><div>  primitiveFFIIntegerAtPut</div><div>  primitiveForceLoad</div>



<div>  primitiveLogCallsTo</div><div>  primitiveSetManualSurfacePointer</div><div>  KlattSynthesizerPlugin</div><div>  declareCVarsIn:</div><div>  initialize</div><div>  moduleName</div><div>  addAmplitudeDiplophonia</div>



<div>  addFlutter</div><div>  addFrequencyDiplophonia</div><div>  addJitter</div><div>  addShimmer</div><div>  antiResonator:frequency:bandwidth:</div><div>  antiResonator:value:</div><div>  cascadeBranch:</div><div>  checkedFloatPtrOf:</div>



<div>  checkedShortPtrOf:</div><div>  glottalSource</div><div>  linearFromdB:</div><div>  loadFrom:</div><div>  nextRandom</div><div>  normalizeGlottalPulse</div><div>  parallelFrictionBranch:</div><div>  parallelVoicedBranch:</div>



<div>  pitchSynchronousReset</div><div>  primitiveSynthesizeFrameIntoStartingAt</div><div>  qu:phi:cosphi:sinphi:rphid:</div><div>  resonator:frequency:bandwidth:</div><div>  resonator:frequency:bandwidth:gain:</div><div>



  resonator:value:</div><div>  resonatorA:</div><div>  resonatorA:put:</div><div>  resonatorB:</div><div>  resonatorB:put:</div><div>  resonatorC:</div><div>  resonatorC:put:</div><div>  resonatorP1:</div><div>  resonatorP1:put:</div>



<div>  resonatorP2:</div><div>  resonatorP2:put:</div><div>  ro:ra:rk:</div><div>  saveTo:</div><div>  setCurrentFrame:</div><div>  synthesizeFrame:into:startingAt:</div><div>  voicedPitchSynchronousReset</div><div>  zeroQphi:cosphi:sinphi:rphid:</div>



<div>  ThreadedARMFFIPlugin</div><div>  calloutStateClass</div><div>  initialize</div><div>  numRegArgs</div><div>  ffiPushDoubleFloat:in:</div><div>  ffiPushPointer:in:</div><div>  ffiPushSignedByte:in:</div><div>  ffiPushSignedChar:in:</div>



<div>  ffiPushSignedLongLong:in:</div><div>  ffiPushSignedShort:in:</div><div>  ffiPushSingleFloat:in:</div><div>  ffiPushUnsignedByte:in:</div><div>  ffiPushUnsignedChar:in:</div><div>  ffiPushUnsignedLong:in:</div><div>



  ffiPushUnsignedLongLong:in:</div><div>  ffiPushUnsignedShort:in:</div><div>  registerArgsSlop</div><div>  ThreadedFFIPlugin</div><div>  ancilliaryStructClasses</div><div>  calloutStateClass</div><div>  declareCVarsIn:</div>



<div>  initialize</div><div>  maxNumArgs</div><div>  moduleName</div><div>  preambleCCode</div><div>  prepareToBeAddedToCodeGenerator:</div><div>  allocaLiesSoUseGetsp</div><div>  atomicTypeOf:</div><div>  cStackAlignment</div>



<div>  cleanupCalloutState:</div><div>  dispatchFunctionPointer:</div><div>  externalFunctionHasStackSizeSlot</div><div>  ffiAddressOf:startingAt:size:</div><div>  ffiAlloc:</div><div>  ffiArgByValue:in:</div><div>  ffiArgument:Spec:Class:in:</div>



<div>  ffiAtomicArgByReference:Class:in:</div><div>  ffiAtomicStructByReference:Class:in:</div><div>  ffiCall:ArgArrayOrNil:NumArgs:</div><div>  ffiCalloutTo:SpecOnStack:in:</div><div>  ffiCheckReturn:With:in:</div><div>


  ffiContentsOfHandle:errCode:</div>
<div>  ffiCreateIntegralResultOop:ofAtomicType:in:</div><div>  ffiFail:</div><div>  ffiFloatValueOf:</div><div>  ffiFree:</div><div>  ffiIntegerValueOf:</div><div>  ffiLoadCalloutAddress:</div><div>  ffiLoadCalloutAddressFrom:</div>



<div>  ffiLoadCalloutModule:</div><div>  ffiLogCallout:</div><div>  ffiLogCallsTo:</div><div>  ffiPushDoubleFloat:in:</div><div>  ffiPushPointer:in:</div><div>  ffiPushPointerContentsOf:in:</div><div>  ffiPushSignedByte:in:</div>



<div>  ffiPushSignedChar:in:</div><div>  ffiPushSignedInt:in:</div><div>  ffiPushSignedLongLong:in:</div><div>  ffiPushSignedLongLongOop:in:</div><div>  ffiPushSignedShort:in:</div><div>  ffiPushSingleFloat:in:</div><div>



  ffiPushString:OfLength:in:</div><div>  ffiPushStructure:ofSize:typeSpec:ofLength:in:</div><div>  ffiPushStructureContentsOf:in:</div><div>  ffiPushUnsignedByte:in:</div><div>  ffiPushUnsignedChar:in:</div><div>  ffiPushUnsignedInt:in:</div>



<div>  ffiPushUnsignedLongLong:in:</div><div>  ffiPushUnsignedLongLongOop:in:</div><div>  ffiPushUnsignedShort:in:</div><div>  ffiPushVoid:in:</div><div>  ffiReturnCStringFrom:</div><div>  ffiReturnPointer:ofType:in:</div>



<div>  ffiReturnStruct:ofType:in:</div><div>  ffiReturnType:</div><div>  ffiSupportsCallingConvention:</div><div>  ffiValidateExternalData:AtomicType:</div><div>  initialiseModule</div><div>  isAlien:</div><div>  isAtomicType:</div>



<div>  isCalleePopsConvention:</div><div>  isDirectAlien:</div><div>  nonRegisterStructReturnIsViaImplicitFirstArgument</div><div>  primitiveCallout</div><div>  primitiveCalloutWithArgs</div><div>  primitiveCreateManualSurface</div>



<div>  primitiveDestroyManualSurface</div><div>  primitiveFFIAllocate</div><div>  primitiveFFIDoubleAt</div><div>  primitiveFFIDoubleAtPut</div><div>  primitiveFFIFloatAt</div><div>  primitiveFFIFloatAtPut</div><div>  primitiveFFIFree</div>



<div>  primitiveFFIGetLastError</div><div>  primitiveFFIIntegerAt</div><div>  primitiveFFIIntegerAtPut</div><div>  primitiveForceLoad</div><div>  primitiveLogCallsTo</div><div>  primitiveSetManualSurfacePointer</div><div>



  registerArgsSlop</div><div>  returnStructInRegisters:</div><div>  sizeField:</div><div>  startOfData:</div><div>  ThreadedIA32FFIPlugin</div><div>  ffiCalloutTo:SpecOnStack:in:</div><div>  ffiPushDoubleFloat:in:</div><div>



  ffiPushPointer:in:</div><div>  ffiPushSignedByte:in:</div><div>  ffiPushSignedChar:in:</div><div>  ffiPushSignedInt:in:</div><div>  ffiPushSignedLongLong:in:</div><div>  ffiPushSignedShort:in:</div><div>  ffiPushSingleFloat:in:</div>



<div>  ffiPushStructure:ofSize:typeSpec:ofLength:in:</div><div>  ffiPushUnsignedByte:in:</div><div>  ffiPushUnsignedChar:in:</div><div>  ffiPushUnsignedInt:in:</div><div>  ffiPushUnsignedLongLong:in:</div><div>  ffiPushUnsignedShort:in:</div>



<div>  ffiReturnStruct:ofType:in:</div><div>  registerArgsSlop</div><div>  returnStructInRegisters:</div><div>  ThreadedPPCBEFFIPlugin</div><div>  calloutStateClass</div><div>  initialize</div><div>  numRegArgs</div><div>



  ffiPushDoubleFloat:in:</div><div>  ffiPushPointer:in:</div><div>  ffiPushSignedByte:in:</div><div>  ffiPushSignedChar:in:</div><div>  ffiPushSignedInt:in:</div><div>  ffiPushSignedLongLong:in:</div><div>  ffiPushSignedShort:in:</div>



<div>  ffiPushSingleFloat:in:</div><div>  ffiPushUnsignedByte:in:</div><div>  ffiPushUnsignedChar:in:</div><div>  ffiPushUnsignedInt:in:</div><div>  ffiPushUnsignedLong:in:</div><div>  ffiPushUnsignedLongLong:in:</div><div>



  ffiPushUnsignedShort:in:</div><div>  registerArgsSlop</div><div>  returnStructInRegisters:</div><div><br></div><div><br></div><div>Select Proceed to continue, or close this window to cancel the operation.</div></div><div class="gmail_extra">


<br><br><div class="gmail_quote">2013/4/12 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


 <br><br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 2:43 AM, <a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a> <span dir="ltr">&lt;<a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><div>This is what I do have:</div><div><br></div>VMClass subclass: #InterpreterPrimitives<div>VMClass subclass: #ObjectMemory<br>



<div>ObjectMemory subclass: #Interpreter</div></div><div><br></div>

<div>and also:</div><div><br></div><div>InterpreterPrimitives subclass: #StackInterpreter<br></div><div>StackInterpreter subclass: #StackInterpreterPrimitives<br></div><div><br></div><div>

I am interested in getting Interpreter to work at this point, not StackInterpreter, in the simulator.</div></div></blockquote><div><br></div><div>Then I would either move to VMMaker or be prepared for a fair bit of work.  I haven&#39;t worked on the Interpreter in the Cog branch for many years.  </div>



<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>StackIntepreter simulation has other problems:</div><div><br></div><div>





<div>UndefinedObject(Object)&gt;&gt;doesNotUnderstand: #adaptToNumber:andSend:</div><div>UndefinedObject(Object)&gt;&gt;adaptToInteger:andSend:</div><div>SmallInteger(Integer)&gt;&gt;quo:</div><div>SmallInteger&gt;&gt;quo:</div>





<div>SmallInteger(Integer)&gt;&gt;//</div><div>SmallInteger&gt;&gt;//</div><div>StackInterpreterSimulatorLSB(StackInterpreter)&gt;&gt;interpreterAllocationReserveBytes</div><div>StackInterpreterSimulatorLSB(StackInterpreterSimulator)&gt;&gt;openOn:extraMemory: in Block: [f := FileStream readOnlyFileNamed: fileName....</div>





<div>BlockClosure&gt;&gt;ensure:</div><div>StackInterpreterSimulatorLSB(StackInterpreterSimulator)&gt;&gt;openOn:extraMemory:</div><div>StackInterpreterSimulatorLSB(StackInterpreterSimulator)&gt;&gt;openOn:</div><div>UndefinedObject&gt;&gt;DoIt</div>





<div><br></div><div>Looks like all of this needs some love... no problem doing that but I need to sort out these questions with your help :-)</div></div></div></blockquote><div><br></div><div>This should be easy to solve.  Hmmm, works in e.g. VMMaker.oscog-eem.284.</div>



<div><br></div><div>Try launching it with</div><div><br></div><div><div>| vm |</div><div>StackInterpreter initializeWithOptions: (Dictionary newFromPairs: #()).</div><div>vm := StackInterpreterSimulator new.</div><div>vm openOn: &#39;some.image&#39;.</div>



<div>vm openAsMorph; run</div></div><div><br></div><div><br></div><div>If it doesn&#39;t work then you need to reintegrate from VMMaker.oscog-eem.284.</div><div><br></div><div>HTH</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="ltr"><div><div><br></div><div>Phil</div><div><br></div></div><div>

<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/11 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span><br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><br><br><div class="gmail_quote">On Thu, Apr 11, 2013 at 2:11 AM, <a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a> <span dir="ltr">&lt;<a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">Hello,<div><br></div><div>I&#39;ve been working on getting the simulator to work from VMMaker.</div>






<div><br></div><div>Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).</div>

<div><br></div><div>Then, I am now running the test of the sim:</div><div><br></div><div><div>test</div><div><span style="white-space:pre-wrap">        </span>transcript clear.</div><div><span style="white-space:pre-wrap">        </span>byteCount := 0.</div>








<div><span style="white-space:pre-wrap">        </span>quitBlock := [^ self].</div><div><span style="white-space:pre-wrap">        </span>self internalizeIPandSP.</div><div><span style="white-space:pre-wrap">        </span>self fetchNextBytecode.</div>








<div><span style="white-space:pre-wrap">        </span>[true] whileTrue:</div><div><span style="white-space:pre-wrap">                </span>[self dispatchOn: currentBytecode in: BytecodeTable.</div><div><span style="white-space:pre-wrap">                </span>byteCount := byteCount + 1.</div>








<div><span style="white-space:pre-wrap">                </span>byteCount \\ 10000 = 0 ifTrue: [self fullDisplay]].</div><div><span style="white-space:pre-wrap">        </span>self externalizeIPandSP.</div><div><br></div><div><br></div>

<div>and I hit an issue:</div><div><br></div><div>MNU: isInstanceOfClassFloat: oop.</div><div><div><div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;floatValueOf:</div><div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;loadFloatOrIntFrom:</div>








<div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;primitiveFloatEqual:toArg:</div><div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;bytecodePrimEqual</div><div>InterpreterSimulatorLSB(InterpreterSimulator)&gt;&gt;dispatchOn:in:</div>








<div>InterpreterSimulatorLSB(InterpreterSimulator)&gt;&gt;test</div><div>UndefinedObject&gt;&gt;DoIt</div><div><br></div></div><div>This happens here:</div><div><br></div><div><div>floatValueOf: oop</div><div>

<span style="white-space:pre-wrap">        </span>&quot;Answer the C double precision floating point value of the argument,</div><div><span style="white-space:pre-wrap">        </span> or fail if it is not a Float, and answer 0.</div>








<div><span style="white-space:pre-wrap">        </span> Note: May be called by translated primitive code.&quot;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>| isFloat result |</div><div><span style="white-space:pre-wrap">        </span>&lt;returnTypeC: #double&gt;</div>








<div><span style="white-space:pre-wrap">        </span>&lt;var: #result type: #double&gt;</div><div><span style="white-space:pre-wrap">        </span>isFloat := self isInstanceOfClassFloat: oop.</div><div><span style="white-space:pre-wrap">        </span>isFloat ifTrue:</div>








<div><span style="white-space:pre-wrap">                </span>[self cCode: &#39;&#39; inSmalltalk: [result := Float new: 2].</div><div><span style="white-space:pre-wrap">                </span> self fetchFloatAt: oop + BaseHeaderSize into: result.</div>








<div><span style="white-space:pre-wrap">                </span> ^result].</div><div><span style="white-space:pre-wrap">        </span>self primitiveFail.</div><div><span style="white-space:pre-wrap">        </span>^0.0</div></div><div><br>

</div><div>There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.</div><div><br></div><div><div>InterpreterPrimitives&gt;&gt;isInstanceOfClassFloat: oop</div><div>

<span style="white-space:pre-wrap">        </span>&lt;inline: true&gt;</div><div><span style="white-space:pre-wrap">        </span>&quot;N.B.  Because Slang always inlines is:instanceOf:compactClassIndex:</div><div><span style="white-space:pre-wrap">        </span> (because is:instanceOf:compactClassIndex: has an inline: pragma) the</div>








<div><span style="white-space:pre-wrap">        </span> phrase (objectMemory splObj: ClassFloat) is expanded in-place and is</div><div><span style="white-space:pre-wrap">        </span> _not_ evaluated if oop has a non-zero CompactClassIndex.&quot;</div>








<div><span style="white-space:pre-wrap">        </span>^objectMemory</div><div><span style="white-space:pre-wrap">                </span>is: oop</div><div><span style="white-space:pre-wrap">                </span>instanceOf: (objectMemory splObj: ClassFloat) </div>








<div><span style="white-space:pre-wrap">                </span>compactClassIndex: ClassFloatCompactIndex</div><div><br></div><div>Clues?</div></div></div></div></div></blockquote><div><br></div><div>Just copy the method into Interpreter and replace objectMemory with self.  But I don&#39;t understand which VMMsker you&#39;re using.  In David Lewis&#39; trunk, e.g. VMMaker-dtl.316, Interpreter inherits from InterpreterPrimitives.</div>






<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><br></div><div>Phil</div></div></div></div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
<br></blockquote></div><br></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
<br></blockquote></div><br></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>